summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2008-03-09 19:54:28 +0000
committerjoerg <joerg@pkgsrc.org>2008-03-09 19:54:28 +0000
commitdd86c24e6c7e44c0bf570f1712522dbe8c4408c2 (patch)
tree34110e91e98839e2dffb00d296c2bc1b8066be34
parentcbeeb7c81110fc72941d1c2016bbd94c4bc15794 (diff)
downloadpkgsrc-dd86c24e6c7e44c0bf570f1712522dbe8c4408c2.tar.gz
Update bmake to 20080215. I'll take care of pkgsrc maintainership.
Changes include many bugfixes and performance speed ups. See ChangeLog for details.
-rw-r--r--devel/bmake/Makefile8
-rw-r--r--devel/bmake/files/ChangeLog127
-rw-r--r--devel/bmake/files/Makefile.in52
-rw-r--r--devel/bmake/files/PSD.doc/Makefile2
-rw-r--r--devel/bmake/files/PSD.doc/tutorial.ms2
-rw-r--r--devel/bmake/files/aclocal.m419
-rw-r--r--devel/bmake/files/arch.c6
-rw-r--r--devel/bmake/files/bmake.1167
-rwxr-xr-xdevel/bmake/files/boot-strap65
-rw-r--r--devel/bmake/files/buf.c6
-rw-r--r--devel/bmake/files/buf.h2
-rw-r--r--devel/bmake/files/compat.c88
-rw-r--r--devel/bmake/files/cond.c383
-rw-r--r--devel/bmake/files/config.h.in31
-rwxr-xr-xdevel/bmake/files/configure6120
-rw-r--r--devel/bmake/files/configure.in54
-rw-r--r--devel/bmake/files/dir.c6
-rw-r--r--devel/bmake/files/dir.h2
-rw-r--r--devel/bmake/files/for.c6
-rw-r--r--devel/bmake/files/getenv.c2
-rw-r--r--devel/bmake/files/getopt.c2
-rw-r--r--devel/bmake/files/hash.c6
-rw-r--r--devel/bmake/files/hash.h2
-rwxr-xr-xdevel/bmake/files/install-sh2
-rw-r--r--devel/bmake/files/job.c2175
-rw-r--r--devel/bmake/files/job.h113
-rw-r--r--devel/bmake/files/lst.h2
-rw-r--r--devel/bmake/files/lst.lib/Makefile2
-rw-r--r--devel/bmake/files/lst.lib/lstAppend.c6
-rw-r--r--devel/bmake/files/lst.lib/lstAtEnd.c6
-rw-r--r--devel/bmake/files/lst.lib/lstAtFront.c6
-rw-r--r--devel/bmake/files/lst.lib/lstClose.c6
-rw-r--r--devel/bmake/files/lst.lib/lstConcat.c6
-rw-r--r--devel/bmake/files/lst.lib/lstDatum.c6
-rw-r--r--devel/bmake/files/lst.lib/lstDeQueue.c6
-rw-r--r--devel/bmake/files/lst.lib/lstDestroy.c6
-rw-r--r--devel/bmake/files/lst.lib/lstDupl.c6
-rw-r--r--devel/bmake/files/lst.lib/lstEnQueue.c6
-rw-r--r--devel/bmake/files/lst.lib/lstFind.c6
-rw-r--r--devel/bmake/files/lst.lib/lstFindFrom.c6
-rw-r--r--devel/bmake/files/lst.lib/lstFirst.c6
-rw-r--r--devel/bmake/files/lst.lib/lstForEach.c6
-rw-r--r--devel/bmake/files/lst.lib/lstForEachFrom.c6
-rw-r--r--devel/bmake/files/lst.lib/lstInit.c6
-rw-r--r--devel/bmake/files/lst.lib/lstInsert.c6
-rw-r--r--devel/bmake/files/lst.lib/lstInt.h14
-rw-r--r--devel/bmake/files/lst.lib/lstIsAtEnd.c6
-rw-r--r--devel/bmake/files/lst.lib/lstIsEmpty.c6
-rw-r--r--devel/bmake/files/lst.lib/lstLast.c6
-rw-r--r--devel/bmake/files/lst.lib/lstMember.c6
-rw-r--r--devel/bmake/files/lst.lib/lstNext.c6
-rw-r--r--devel/bmake/files/lst.lib/lstOpen.c6
-rw-r--r--devel/bmake/files/lst.lib/lstRemove.c6
-rw-r--r--devel/bmake/files/lst.lib/lstReplace.c6
-rw-r--r--devel/bmake/files/lst.lib/lstSucc.c6
-rw-r--r--devel/bmake/files/lst.lib/makefile.boot.in4
-rwxr-xr-xdevel/bmake/files/machine.sh2
-rw-r--r--devel/bmake/files/main.c530
-rw-r--r--devel/bmake/files/make-conf.h2
-rw-r--r--devel/bmake/files/make.12
-rw-r--r--devel/bmake/files/make.c6
-rw-r--r--devel/bmake/files/make.h2
-rw-r--r--devel/bmake/files/makefile.boot.in21
-rw-r--r--devel/bmake/files/missing/sys/cdefs.h2
-rwxr-xr-xdevel/bmake/files/mkdeps.sh2
-rw-r--r--devel/bmake/files/nonints.h2
-rw-r--r--devel/bmake/files/os.sh2
-rw-r--r--devel/bmake/files/parse.c6
-rw-r--r--devel/bmake/files/pathnames.h25
-rw-r--r--devel/bmake/files/ranlib.h2
-rw-r--r--devel/bmake/files/setenv.c2
-rw-r--r--devel/bmake/files/sigcompat.c9
-rw-r--r--devel/bmake/files/sprite.h2
-rw-r--r--devel/bmake/files/str.c6
-rw-r--r--devel/bmake/files/suff.c6
-rw-r--r--devel/bmake/files/targ.c6
-rw-r--r--devel/bmake/files/trace.c6
-rw-r--r--devel/bmake/files/trace.h2
-rw-r--r--devel/bmake/files/unit-tests/Makefile.in4
-rw-r--r--devel/bmake/files/unit-tests/cond12
-rw-r--r--devel/bmake/files/unit-tests/modorder2
-rw-r--r--devel/bmake/files/unit-tests/modword2
-rw-r--r--devel/bmake/files/unit-tests/posix2
-rw-r--r--devel/bmake/files/unit-tests/varcmd2
-rw-r--r--devel/bmake/files/util.c8
-rw-r--r--devel/bmake/files/var.c2553
-rw-r--r--devel/bmake/files/wait.h2
87 files changed, 5972 insertions, 6876 deletions
diff --git a/devel/bmake/Makefile b/devel/bmake/Makefile
index 5206429ebd7..f7ba93efee2 100644
--- a/devel/bmake/Makefile
+++ b/devel/bmake/Makefile
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.40 2008/03/03 17:45:34 jlam Exp $
+# $NetBSD: Makefile,v 1.41 2008/03/09 19:54:28 joerg Exp $
#
-DISTNAME= bmake-20051105
-PKGREVISION= 4
+DISTNAME= bmake-20080215
CATEGORIES= devel
MASTER_SITES= # empty
DISTFILES= # empty
@@ -10,7 +9,7 @@ DISTFILES= # empty
# distfile obtained from ftp://ftp.NetBSD.org/pub/NetBSD/misc/sjg/
# source is kept in files/ for bootstrap purposes
-MAINTAINER= pkgsrc-users@NetBSD.org
+MAINTAINER= joerg@NetBSD.org
HOMEPAGE= http://www.crufty.net/help/sjg/bmake.html
COMMENT= Portable (autoconf) version of NetBSD 'make' utility
@@ -20,7 +19,6 @@ PKG_DESTDIR_SUPPORT= user-destdir
WRKSRC= ${WRKDIR}/bmake
NO_CHECKSUM= yes
-NO_MTREE= yes
USE_FEATURES= nbcompat
diff --git a/devel/bmake/files/ChangeLog b/devel/bmake/files/ChangeLog
index c865b948667..d9244b5bf8d 100644
--- a/devel/bmake/files/ChangeLog
+++ b/devel/bmake/files/ChangeLog
@@ -1,3 +1,130 @@
+2008-02-15 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * merge some patches from NetBSD pkgsrc.
+
+ * makefile.boot.in (BOOTSTRAP_SYS_PATH): Allow better control of
+ the MAKSYSPATH used during bootstrap.
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20080215
+ * Merge with NetBSD make, pick up:
+ o warn if non-space chars follow 'empty' in a conditional.
+
+2008-01-18 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20080118
+ * Merge with NetBSD make, pick up:
+ o consider dependencies read from .depend as optional - dsl
+ o remember when buffer for reading makefile grows - dsl
+ o add -dl (aka LOUD) - David O'Brien
+
+2007-10-22 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20071022
+ * Merge with NetBSD make, pick up:
+ o Allow .PATH<suffix> to be used for .include ""
+
+ * boot-strap: source default settings from .bmake-boot-strap.rc
+
+2007-10-16 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in: fix maninstall on various systems
+ provided that our man.mk is used.
+ For non-BSD systems we install the preformatted page
+ into $MANDIR/cat1
+
+2007-10-15 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * boot-strap: make bmake.1 too, so maninstall works.
+
+2007-10-14 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20071014
+ * Merge with NetBSD make, pick up:
+ o revamped handling of defshell - configure no longer needs to
+ know the content of the shells array - apb
+ o stop Var_Subst modifying its input - apb
+ o avoid calling ParseTrackInput too often - dsl
+
+2007-10-11 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump version to 20071011
+ * Merge with NetBSD make, pick up:
+ o fix Shell_Init for case that _BASENAME_DEFSHELL is absolute path.
+
+ * sigcompat.c: some tweaks for HP-UX 11.x based on
+ patch from Tobias Nygren
+
+ * configure.in: update handling of --with-defshell to match
+ new make behavior. --with-defshell=/usr/xpg4/bin/sh
+ will now do what one might hope - provided the chosen shell
+ behaves enough like sh.
+
+2007-10-08 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20071008
+ * Merge with NetBSD make, pick up:
+ o .MAKE.JOB.PREFIX - control the token output before jobs - sjg
+ o .export/.MAKE.EXPORTED - export of variables - sjg
+ o .MAKE.MAKEFILES - track all makefiles read - sjg
+ o performance improvements - dsl
+ o revamp parallel job scheduling - dsl
+
+2006-07-28 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20060728
+ * Merge with NetBSD make, pick up:
+ o extra debug info during variable and cond processing - sjg
+ o shell definition now covers newline - rillig
+ o minor mem leak in PrintOnError - sjg
+
+2006-05-11 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20060511
+ * Merge with NetBSD make, pick up:
+ o more memory leaks - coverity
+ o possible overflow in ArchFindMember - coverity
+ o extract variable modifier code out of Var_Parse()
+ so it can be called recursively - sjg
+ o unit-tests/moderrs - sjg
+
+2006-04-12 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20060412
+ * Merge with NetBSD make, pick up:
+ o fixes for some memory leaks - coverity
+ o only read first sys.mk etc when searching sysIncPath - sjg
+
+ * main.c (ReadMakefile): remove hack for __INTERIX that prevented
+ setting ${MAKEFILE} - OBATA Akio
+
+2006-03-18 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20060318
+ * Merge with NetBSD make, pick up:
+ o cleanup of job.c to remove remote handling, distcc is more
+ useful and this code was likely bit-rotting - dsl
+ o fix for :P modifier - sjg
+ * boot-strap: set default prefix to something reasonable
+ (for me anyway).
+
+2006-03-01 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20060301
+ * Merge with NetBSD make, pick up:
+ o make .WAIT apply recursively, document and test case - apb
+ o allow variable modifiers in a variable appear anywhere in
+ modifier list, document and test case - sjg
+
+2006-02-22 Simon J. Gerraty <sjg@void.crufty.net>
+
+ * Makefile.in (BMAKE_VERSION): bump to 20060222
+ * Merge with NetBSD make, pick up:
+ o improved job token handling - dsl
+ o SIG_DFL the correct signal before exec - dsl
+ o more debug info during parsing - dsl
+ o allow variable modifiers to be specified via variable - sjg
+ * boot-strap: explain why we died if no mksrc
+
2005-11-05 Simon J. Gerraty <sjg@void.crufty.net>
* Makefile.in (BMAKE_VERSION): bump to 20051105
diff --git a/devel/bmake/files/Makefile.in b/devel/bmake/files/Makefile.in
index 3c3302d78ce..a15a4a3e2f6 100644
--- a/devel/bmake/files/Makefile.in
+++ b/devel/bmake/files/Makefile.in
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile.in,v 1.5 2007/09/06 19:23:25 joerg Exp $
+# $NetBSD: Makefile.in,v 1.6 2008/03/09 19:54:29 joerg Exp $
# @(#)Makefile 5.2 (Berkeley) 12/28/90
-# $Id: Makefile.in,v 1.5 2007/09/06 19:23:25 joerg Exp $
+# $Id: Makefile.in,v 1.6 2008/03/09 19:54:29 joerg Exp $
PROG= bmake
SRCS= arch.c buf.c compat.c cond.c dir.c for.c hash.c job.c main.c \
@@ -11,6 +11,7 @@ SRCS+= lstAppend.c lstAtEnd.c lstAtFront.c lstClose.c lstConcat.c \
lstFind.c lstFindFrom.c lstFirst.c lstForEach.c lstForEachFrom.c \
lstInit.c lstInsert.c lstIsAtEnd.c lstIsEmpty.c lstLast.c \
lstMember.c lstNext.c lstOpen.c lstRemove.c lstReplace.c lstSucc.c
+SRCS += lstPrev.c
.if !empty(LIBOBJS)
SRCS+= ${LIBOBJS:.o=.c}
@@ -22,21 +23,15 @@ srcdir= @srcdir@
CC?= @CC@
# Base version on src date
-BMAKE_VERSION= 20051105
+BMAKE_VERSION= 20080215
# knowing when it was built is also handy
BUILD_DATE!= date +%Y%m%d
MAKE_VERSION:= bmake-${BMAKE_VERSION} build-${BUILD_DATE}
MACHINE=@machine@
MACHINE_ARCH=@machine_arch@
+DEFAULT_SYS_PATH = @default_sys_path@
-DEFAULT_CSH = @DEFAULT_CSH@
-DEFAULT_KSH = @DEFAULT_KSH@
-DEFAULT_SH = @DEFAULT_SH@
-DEFAULT_SYS_PATH = @DEFAULT_SYS_PATH@
-
-CFLAGS+= @CFLAGS@ -DDEFAULT_CSH=\"${DEFAULT_CSH}\"
-CFLAGS+= -DDEFAULT_KSH=\"${DEFAULT_KSH}\" -DDEFAULT_SH=\"${DEFAULT_SH}\"
-CFLAGS+= -DDEFAULT_SYS_PATH=\"${DEFAULT_SYS_PATH}\"
+CFLAGS+= -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
CFLAGS+= -I. -I${srcdir} @DEFS@ @CPPFLAGS@ ${XDEFS} -DMAKE_NATIVE
CFLAGS+= ${CFLAGS_${.TARGET:T}}
CFLAGS_main.o= "-DMAKE_VERSION=\"${MAKE_VERSION}\""
@@ -57,7 +52,7 @@ isBSD44= NetBSD FreeBSD OpenBSD DragonFly
# Don't set these for anyone else since we don't know what the effect may be.
# On FreeBSD WARNS=2 sets a bunch of -W flags that make does not handle.
WFORMAT= 1
-WARNS=3
+WARNS=4
.NOPATH: bmake.cat1
.if make(install) && exists(${DESTDIR}/usr/share/doc)
SUBDIR= PSD.doc
@@ -68,7 +63,7 @@ SUBDIR= PSD.doc
# XXX not sure if we still want this given that configure
# lets us force or not the definition of MACHINE.
CFLAGS_main.o+= "-DFORCE_MACHINE=\"${MACHINE}\""
-NOMAN=no
+MANTARGET=cat
SRCS+= getenv.c
INSTALL?=${srcdir}/install-sh
.if (${MACHINE} == "sun386")
@@ -103,6 +98,20 @@ ${MAN}: make.1
.endif
+.if !empty(isBSD44:M${OS})
+.if "${OS}" != "NetBSD"
+MAN1=${MAN}
+.endif
+MANTARGET?=man
+.endif
+
+MANTARGET?= cat
+MANDEST?= ${MANDIR}/${MANTARGET}1
+
+.if ${MANTARGET} == "cat"
+_mfromdir=${srcdir}
+.endif
+
.if exists(${srcdir}/../Makefile.inc)
.include "${srcdir}/../Makefile.inc"
.endif
@@ -118,15 +127,6 @@ ${MAN}: make.1
BINDIR= ${prefix}/bin
MANDIR= ${prefix}/man
-.if "${OS}" != "NetBSD" && !empty(isBSD44:M${OS})
-# freebsd's bsd.man.mk works differently
-MAN1=${MAN}
-MANDIR= ${prefix}/man/man
-MANDEST= ${MANDIR}1
-.NOPATH: bmake.cat1
-.endif
-MANDEST?= ${MANDIR}
-
arch.o: config.h
# make sure that MAKE_VERSION gets updated.
main.o: ${SRCS} ${MAKEFILE}
@@ -149,6 +149,14 @@ install-mk:
@echo need to unpack mk.tar.gz under ${srcdir} or set MKSRC; false
.endif
+.ifdef TOOLDIR
+# this is a native netbsd build,
+# use libutil rather than the local emalloc etc.
+CPPFLAGS+= -DHAVE_EMALLOC
+LDADD+=-lutil
+DPADD+=${LIBUTIL}
+.endif
+
# A simple unit-test driver to help catch regressions
accept test:
cd ${.CURDIR}/unit-tests && ${.MAKE:S,^./,${.CURDIR}/,} TEST_MAKE=${TEST_MAKE:U${.OBJDIR}/${PROG:T}} ${.TARGET}
diff --git a/devel/bmake/files/PSD.doc/Makefile b/devel/bmake/files/PSD.doc/Makefile
index b95efc51201..ea2c8b3b454 100644
--- a/devel/bmake/files/PSD.doc/Makefile
+++ b/devel/bmake/files/PSD.doc/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $
+# $NetBSD: Makefile,v 1.2 2008/03/09 19:54:29 joerg Exp $
# @(#)Makefile 8.1 (Berkeley) 8/14/93
DIR= psd/12.make
diff --git a/devel/bmake/files/PSD.doc/tutorial.ms b/devel/bmake/files/PSD.doc/tutorial.ms
index 056da3b23c3..52741084514 100644
--- a/devel/bmake/files/PSD.doc/tutorial.ms
+++ b/devel/bmake/files/PSD.doc/tutorial.ms
@@ -1,4 +1,4 @@
-.\" $NetBSD: tutorial.ms,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $
+.\" $NetBSD: tutorial.ms,v 1.2 2008/03/09 19:54:29 joerg Exp $
.\" Copyright (c) 1988, 1989, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
diff --git a/devel/bmake/files/aclocal.m4 b/devel/bmake/files/aclocal.m4
index 4810da9e665..0d536029551 100644
--- a/devel/bmake/files/aclocal.m4
+++ b/devel/bmake/files/aclocal.m4
@@ -1,5 +1,5 @@
dnl RCSid:
-dnl $Id: aclocal.m4,v 1.2 2006/03/01 16:54:46 joerg Exp $
+dnl $Id: aclocal.m4,v 1.3 2008/03/09 19:54:29 joerg Exp $
dnl
dnl
@@ -48,18 +48,17 @@ ifelse([$4], , , [else
fi
])
-dnl From heimdal sources
-dnl Id: c-attribute.m4,v 1.5 2004/08/26 12:35:41 joda Exp
-dnl
-
dnl
dnl Test for __attribute__
dnl
-AC_DEFUN([AC_C___ATTRIBUTE__], [
+AC_DEFUN(AC_C___ATTRIBUTE__, [
AC_MSG_CHECKING(for __attribute__)
AC_CACHE_VAL(ac_cv___attribute__, [
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include <stdlib.h>
+AC_TRY_COMPILE([
+#include <stdlib.h>
+],
+[
static void foo(void) __attribute__ ((noreturn));
static void
@@ -67,9 +66,9 @@ foo(void)
{
exit(1);
}
-]])],
-[ac_cv___attribute__=yes],
-[ac_cv___attribute__=no])])
+],
+ac_cv___attribute__=yes,
+ac_cv___attribute__=no)])
if test "$ac_cv___attribute__" = "yes"; then
AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
fi
diff --git a/devel/bmake/files/arch.c b/devel/bmake/files/arch.c
index 98be9f25c20..a8efdf345a5 100644
--- a/devel/bmake/files/arch.c
+++ b/devel/bmake/files/arch.c
@@ -1,4 +1,4 @@
-/* $NetBSD: arch.c,v 1.1.1.2 2008/03/09 19:39:32 joerg Exp $ */
+/* $NetBSD: arch.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: arch.c,v 1.1.1.2 2008/03/09 19:39:32 joerg Exp $";
+static char rcsid[] = "$NetBSD: arch.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)arch.c 8.2 (Berkeley) 1/2/94";
#else
-__RCSID("$NetBSD: arch.c,v 1.1.1.2 2008/03/09 19:39:32 joerg Exp $");
+__RCSID("$NetBSD: arch.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/bmake.1 b/devel/bmake/files/bmake.1
index e7126991236..50908ded1b9 100644
--- a/devel/bmake/files/bmake.1
+++ b/devel/bmake/files/bmake.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: bmake.1,v 1.1 2006/07/14 15:58:08 jlam Exp $
+.\" $NetBSD: bmake.1,v 1.2 2008/03/09 19:54:29 joerg Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" from: @(#)make.1 8.4 (Berkeley) 3/19/94
.\"
-.Dd June 27, 2005
+.Dd November 19, 2006
.Dt MAKE 1
.Os
.Sh NAME
@@ -74,12 +74,15 @@
is a program designed to simplify the maintenance of other programs.
Its input is a list of specifications as to the files upon which programs
and other files depend.
-If the file
+If no
+.Fl f Ar makefile
+makefile option is given,
+.Nm
+will try to open
.Ql Pa makefile
-exists, it is read for this list of specifications.
-If it does not exist, the file
+then
.Ql Pa Makefile
-is read.
+in order to find the specifications.
If the file
.Ql Pa .depend
exists, it is read (see
@@ -91,6 +94,11 @@ For a more thorough description of
and makefiles, please refer to
.%T "Make \- A Tutorial" .
.Pp
+.Nm
+will prepend the contents of the
+.Va MAKEFLAGS
+environment variable to the command line arguments before parsing them.
+.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl B
@@ -100,10 +108,15 @@ by executing the commands to make the sources of a dependency line in sequence.
Define
.Ar variable
to be 1, in the global context.
-.It Fl d Ar flags
+.It Fl d Ar [-]flags
Turn on debugging, and specify which portions of
.Nm
are to print debugging information.
+Unless the flags are preceded by
+.Ql -
+they are added to the
+.Va MAKEFLAGS
+environment variable and will be processed by any child make processes.
.Ar Flags
is one or more of the following:
.Bl -tag -width Ds
@@ -118,6 +131,15 @@ Print debugging information about conditional evaluation.
Print debugging information about directory searching and caching.
.It Ar e
Print debugging information about failed commands and targets.
+.It Ar F
+Use the rest of
+.Ql flags
+as the name of the file to which the debug output is written.
+If the filename ends
+.Ql .%d
+then the
+.Ql %d
+is replaced by the pid.
.It Ar f
Print debugging information about loop evaluation.
.It Ar "g1"
@@ -129,6 +151,11 @@ on error.
Print the input graph before exiting on error.
.It Ar j
Print debugging information about running multiple shells.
+.It Ar l
+Print commands in Makefiles regardless of whether or not they are prefixed by
+.Ql @
+or other "quiet" flags.
+Also known as "loud" behavior.
.It Ar m
Print debugging information about making targets, including modification
dates.
@@ -140,8 +167,12 @@ These are created via
.Xr mkstemp 3
and have names of the form
.Pa /tmp/makeXXXXX .
-.Em NOTE:
-This can create many file in /tmp so use with care.
+.Em NOTE :
+This can create many file in
+.Pa /tmp
+so use with care.
+.It Ar p
+Print debugging information about makefile parsing.
.It Ar s
Print debugging information about suffix-transformation rules.
.It Ar t
@@ -413,6 +444,11 @@ Assign the value to the variable if it is not already defined.
Assign with expansion, i.e. expand the value before assigning it
to the variable.
Normally, expansion is not done until the variable is referenced.
+.Em NOTE :
+References to undefined variables are
+.Em not
+expanded.
+This can cause problems when variable modifiers are used.
.It Ic \&!=
Expand the value and pass it to the shell for execution and assign
the result to the variable.
@@ -539,7 +575,7 @@ The name that
.Nm
was executed with
.Pq Va argv[0] .
-For compatibily
+For compatibility
.Nm
also sets
.Va .MAKE
@@ -549,6 +585,35 @@ The preferred variable to use is the environment variable
because it is more compatible with other versions of
.Nm
and cannot be confused with the special target with the same name.
+.It Va .MAKE.EXPORTED
+The list of variables exported by
+.Nm .
+.It Va .MAKE.MAKEFILES
+The list of makefiles read by
+.Nm ,
+which is useful for tracking dependencies.
+Each makefile is recorded only once, regardless of the number of times read.
+.It Va .MAKE.PID
+The process-id of
+.Nm .
+.It Va .MAKE.PPID
+The parent process-id of
+.Nm .
+.It Va .MAKE.JOB.PREFIX
+If
+.Nm
+is run with
+.Ar j
+then output for each target is prefixed with a token
+.Ql --- target ---
+the first part of which can be controlled via
+.Va .MAKE.JOB.PREFIX .
+.br
+For example:
+.Li .MAKE.JOB.PREFIX=${.newline}---${.MAKE:T}[${.MAKE.PID}]
+would produce tokens like
+.Ql ---make[1234] target ---
+making it easier to track the degree of parallelism being achieved.
.It Ev MAKEFLAGS
The environment variable
.Ql Ev MAKEFLAGS
@@ -692,11 +757,24 @@ Variable expansion may be modified to select or modify each word of the
variable (where a ``word'' is white-space delimited sequence of characters).
The general format of a variable expansion is as follows:
.Pp
-.Dl {variable[:modifier[:...]]}
+.Dl ${variable[:modifier[:...]]}
.Pp
Each modifier begins with a colon,
which may be escaped with a backslash
.Pq Ql \e .
+.Pp
+A set of modifiers can be specified via a variable, as follows:
+.Pp
+.Dl modifier_variable=modifier[:...]
+.Dl ${variable:${modifier_variable}[:...]}
+.Pp
+In this case the first modifier in the modifier_variable does not
+start with a colon, since that must appear in the referencing
+variable.
+If any of the modifiers in the modifier_variable contain a dollar sign
+.Pq Ql $ ,
+these must be doubled to avoid early expansion.
+.Pp
The supported modifiers are:
.Bl -tag -width EEE
.It Cm \&:E
@@ -1117,6 +1195,18 @@ Conditional expressions are also preceded by a single dot as the first
character of a line.
The possible conditionals are as follows:
.Bl -tag -width Ds
+.It Ic .export Ar variable
+Export the specified global variable.
+If no variable is provided, all globals are exported
+except for internal variables (those that start with
+.Ql \&.
+).
+This is not affected by the
+.Fl X
+flag, so should be used with caution.
+Appending a variable name to
+.Va .MAKE.EXPORTED
+is equivalent to exporting a variable.
.It Ic .undef Ar variable
Un-define the specified global variable.
Only global variables may be un-defined.
@@ -1380,7 +1470,7 @@ option.
.It Ic .PRECIOUS
When
.Nm
-is interrupted, it removes any partially made targets.
+is interrupted, it normally removes any partially made targets.
This source prevents the target from being removed.
.It Ic .RECURSIVE
Synonym for
@@ -1413,8 +1503,30 @@ If
.Ic .WAIT
appears in a dependency line, the sources that precede it are
made before the sources that succeed it in the line.
-Loops are not
-detected and targets that form loops will be silently ignored.
+Since the dependents of files are not made until the file itself
+could be made, this also stops the dependents being built unless they
+are needed for another branch of the dependency tree.
+So given:
+.Bd -literal
+x: a .WAIT b
+ echo x
+a:
+ echo a
+b: b1
+ echo b
+b1:
+ echo b1
+
+.Ed
+the output is always
+.Ql b1 ,
+.Ql b ,
+.Ql a ,
+.Ql x .
+.br
+The ordering imposed by
+.Ic .WAIT
+is only relevant for parallel makes.
.El
.Sh SPECIAL TARGETS
Special targets may not be included with other targets, i.e. they must be
@@ -1480,6 +1592,20 @@ Synonym for
for compatibility with other pmake variants.
.It Ic .ORDER
The named targets are made in sequence.
+This ordering does not add targets to the list of targets to be made.
+Since the dependents of a target do not get built until the target itself
+could be built, unless
+.Ql a
+is built by another part of the dependency graph,
+the following is a dependency loop:
+.Bd -literal
+\&.ORDER a b
+b: a
+.Ed
+.Pp
+The ordering imposed by
+.Ic .ORDER
+is only relevant for parallel makes.
.\" XXX: NOT YET!!!!
.\" .It Ic .PARALLEL
.\" The named targets are executed in parallel mode.
@@ -1543,13 +1669,16 @@ It is typically identical to
The flag to pass the shell to enable error checking.
.It Ar echoFlag
The flag to pass the shell to enable command echoing.
+.It Ar newline
+The string literal to pass the shell that results in a single newline
+character when used outside of any quoting characters.
.El
Example:
.Bd -literal
\&.SHELL: name=ksh path=/bin/ksh hasErrCtl=true \\
check="set -e" ignore="set +e" \\
echo="set -v" quiet="set +v" filter="set +v" \\
- echoFlag=v errFlag=e
+ echoFlag=v errFlag=e newline="'\\n'"
.Ed
.It Ic .SILENT
Apply the
@@ -1599,6 +1728,14 @@ system makefile
.It /usr/share/mk
system makefile directory
.El
+.Sh COMPATIBILITY
+The basic make syntax is compatible between different versions of make,
+however the special variables, variable modifiers and conditionals are not.
+.Pp
+The way that parallel makes are scheduled changed in
+.Nx 4.0
+so that .ORDER and .WAIT apply recursively to the dependant nodes.
+The algorithms used may change again in the future.
.Sh SEE ALSO
.Xr mkdep 1
.Sh HISTORY
diff --git a/devel/bmake/files/boot-strap b/devel/bmake/files/boot-strap
index 054c3c55c67..331a41787ab 100755
--- a/devel/bmake/files/boot-strap
+++ b/devel/bmake/files/boot-strap
@@ -14,6 +14,19 @@
# (http://www.crufty.net/FreeWare/configs.html), $prefix/bin
# and a suitable ~/*bin directory.
#
+# Options:
+#
+# -c "rc"
+# Pick up settings from "rc".
+# We look for '.bmake-boot-strap.rc' before processing
+# options.
+#
+# -m "mksrc"
+# Indicate where the mk files can be found.
+# Default is ./mk or ../mk, set to 'none' to force
+# building without "mksrc" but in that case a sys.mk
+# needs to exist in the default syspath ($prefix/share/mk)
+#
# Possibly useful configure_args:
#
# --with-machine="machine"
@@ -38,7 +51,7 @@
# Simon J. Gerraty <sjg@crufty.net>
# RCSid:
-# $Id: boot-strap,v 1.2 2005/11/10 00:09:34 reed Exp $
+# $Id: boot-strap,v 1.3 2008/03/09 19:54:29 joerg Exp $
#
# @(#) Copyright (c) 2001 Simon J. Gerraty
#
@@ -73,14 +86,31 @@ Error() {
exit 1
}
+source_rc() {
+ rc=$1; shift
+ for d in ${*:-""}
+ do
+ r=${d:+$d/}$rc
+ [ -f $r -a -s $r ] || continue
+ echo "NOTE: reading $r"
+ . $r
+ break
+ done
+}
CONFIGURE_ARGS=
-prefix=
+# pick a useful default prefix (for me at least ;-)
+for prefix in /opt/$HOST_TARGET $HOME/$HOST_TARGET /usr/pkg /usr/local ""
+do
+ [ -d ${prefix:-.} ] && break
+done
srcdir=
mksrc=
objdir=
quiet=:
+source_rc .bmake-boot-strap.rc . $Mydir/.. $HOME
+
while :
do
case "$1" in
@@ -93,6 +123,7 @@ do
-m|--mksrc) mksrc=$2; shift 2;;
-o|--objdir) objdir=$2; shift 2;;
-q) quiet=; shift;;
+ -c) source_rc $2; shift 2;;
--*) CONFIGURE_ARGS="$CONFIGURE_ARGS $1"; shift;;
*=*) eval "$1"; export `IFS="="; set -- $1; echo $1`; shift;;
*) break;;
@@ -133,7 +164,7 @@ none|-) # we don't want it
;;
*) # guess we want mksrc...
mksrc=`GetDir /mk $mksrc $3 ./mk* $srcdir/mk* $srcdir/../mk*`
- [ -d ${mksrc:-/dev/null} ] || Usage
+ [ -d ${mksrc:-/dev/null} ] || Usage "Use '-m none' to build without mksrc"
;;
esac
@@ -148,7 +179,12 @@ case "$CONFIGURE_ARGS" in
*--with-prefix-sys-path*) ;; # skip
*) AddConfigure --with-default-sys-path= $prefix/share/mk;;
esac
-[ "$mksrc" ] && AddConfigure --with-mksrc= $mksrc
+if [ "$mksrc" ]; then
+ AddConfigure --with-mksrc= $mksrc
+ # not all cc's support this
+ export CFLAGS_MF=
+fi
+
$srcdir/configure $CONFIGURE_ARGS || exit 1
${MAKE:-make} -f makefile.boot clean
${MAKE:-make} -f makefile.boot bootstrap || exit 1
@@ -159,15 +195,24 @@ $quiet exit 0
make_version=`./bmake -m ./mk -m /usr/share/mk -f ./Makefile -V MAKE_VERSION | ( read one two; echo $one )`
install_prefix() {
- bdir=$1/bin
+ bindir=$1/bin
+ mandir=$1/share/man
+ mkdir=${2:-$1}/share/mk
echo
echo Commands to install into $1/
echo
- echo mkdir -p $bdir
- echo cp $objdir/bmake $bdir/$make_version
- echo rm -f $bdir/bmake
- echo ln -s $make_version $bdir/bmake
- [ "$mksrc" ] && echo $mksrc/install-mk $1/share/mk
+ echo mkdir -p $bindir
+ echo cp $objdir/bmake $bindir/$make_version
+ echo rm -f $bindir/bmake
+ echo ln -s $make_version $bindir/bmake
+ if [ -s bmake.cat1 ]; then
+ echo mkdir -p $mandir/man1
+ echo cp $srcdir/bmake.1 $mandir/man1
+ else
+ echo mkdir -p $mandir/cat1
+ echo cp $srcdir/bmake.cat1 $mandir/cat1/bmake.1
+ fi
+ [ "$mksrc" ] && echo $mksrc/install-mk $mkdir
}
case $prefix/ in
diff --git a/devel/bmake/files/buf.c b/devel/bmake/files/buf.c
index 91d810426b3..1105ed25c17 100644
--- a/devel/bmake/files/buf.c
+++ b/devel/bmake/files/buf.c
@@ -1,4 +1,4 @@
-/* $NetBSD: buf.c,v 1.1.1.2 2008/03/09 19:39:32 joerg Exp $ */
+/* $NetBSD: buf.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: buf.c,v 1.1.1.2 2008/03/09 19:39:32 joerg Exp $";
+static char rcsid[] = "$NetBSD: buf.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)buf.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: buf.c,v 1.1.1.2 2008/03/09 19:39:32 joerg Exp $");
+__RCSID("$NetBSD: buf.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/buf.h b/devel/bmake/files/buf.h
index 2712571339c..a2c04560af3 100644
--- a/devel/bmake/files/buf.h
+++ b/devel/bmake/files/buf.h
@@ -1,4 +1,4 @@
-/* $NetBSD: buf.h,v 1.1.1.2 2008/03/09 19:39:32 joerg Exp $ */
+/* $NetBSD: buf.h,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
diff --git a/devel/bmake/files/compat.c b/devel/bmake/files/compat.c
index adfdcf09a89..335ae9c9e24 100644
--- a/devel/bmake/files/compat.c
+++ b/devel/bmake/files/compat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: compat.c,v 1.3 2007/03/16 00:51:12 rillig Exp $ */
+/* $NetBSD: compat.c,v 1.4 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: compat.c,v 1.3 2007/03/16 00:51:12 rillig Exp $";
+static char rcsid[] = "$NetBSD: compat.c,v 1.4 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)compat.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: compat.c,v 1.3 2007/03/16 00:51:12 rillig Exp $");
+__RCSID("$NetBSD: compat.c,v 1.4 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -210,35 +210,29 @@ CompatRunCommand(ClientData cmdp, ClientData gnp)
char *cmdStart; /* Start of expanded command */
char *cp, *bp;
Boolean silent, /* Don't print command */
- doIt, /* Execute even if -n */
- errCheck; /* Check errors */
+ doIt; /* Execute even if -n */
+ volatile Boolean errCheck; /* Check errors */
WAIT_T reason; /* Reason for child's death */
- int status; /* Description of child's death */
+ int status; /* Description of child's death */
int cpid; /* Child actually found */
ReturnStatus retstat; /* Status of fork */
LstNode cmdNode; /* Node where current command is located */
- const char **av; /* Argument vector for thing to exec */
+ const char ** volatile av; /* Argument vector for thing to exec */
+ char ** volatile mav;/* Copy of the argument vector for freeing */
int argc; /* Number of arguments in av or 0 if not
* dynamically allocated */
Boolean local; /* TRUE if command should be executed
* locally */
- char *cmd = (char *)cmdp;
+ Boolean useShell; /* TRUE if command should be executed
+ * using a shell */
+ char * volatile cmd = (char *)cmdp;
GNode *gn = (GNode *)gnp;
- /*
- * Avoid clobbered variable warnings by forcing the compiler
- * to ``unregister'' variables
- */
-#if __GNUC__
- (void) &av;
- (void) &errCheck;
- (void) &cmd;
-#endif
silent = gn->type & OP_SILENT;
errCheck = !(gn->type & OP_IGNORE);
doIt = FALSE;
- cmdNode = Lst_Member(gn->commands, (ClientData)cmd);
+ cmdNode = Lst_Member(gn->commands, cmd);
cmdStart = Var_Subst(NULL, cmd, gn, FALSE);
/*
@@ -255,10 +249,10 @@ CompatRunCommand(ClientData cmdp, ClientData gnp)
} else {
cmd = cmdStart;
}
- Lst_Replace(cmdNode, (ClientData)cmdStart);
+ Lst_Replace(cmdNode, cmdStart);
if ((gn->type & OP_SAVE_CMDS) && (gn != ENDNode)) {
- (void)Lst_AtEnd(ENDNode->commands, (ClientData)cmdStart);
+ (void)Lst_AtEnd(ENDNode->commands, cmdStart);
return(0);
} else if (strcmp(cmdStart, "...") == 0) {
gn->type |= OP_SAVE_CMDS;
@@ -268,7 +262,7 @@ CompatRunCommand(ClientData cmdp, ClientData gnp)
while ((*cmd == '@') || (*cmd == '-') || (*cmd == '+')) {
switch (*cmd) {
case '@':
- silent = TRUE;
+ silent = DEBUG(LOUD) ? FALSE : TRUE;
break;
case '-':
errCheck = FALSE;
@@ -285,6 +279,15 @@ CompatRunCommand(ClientData cmdp, ClientData gnp)
while (isspace((unsigned char)*cmd))
cmd++;
+#if !defined(MAKE_NATIVE)
+ /*
+ * In a non-native build, the host environment might be weird enough
+ * that it's necessary to go through a shell to get the correct
+ * behaviour. Or perhaps the shell has been replaced with something
+ * that does extra logging, and that should not be bypassed.
+ */
+ useShell = TRUE;
+#else
/*
* Search for meta characters in the command. If there are no meta
* characters, there's no need to execute a shell to execute the
@@ -293,6 +296,8 @@ CompatRunCommand(ClientData cmdp, ClientData gnp)
for (cp = cmd; !meta[(unsigned char)*cp]; cp++) {
continue;
}
+ useShell = (*cp != '\0');
+#endif
/*
* Print the command before echoing if we're not supposed to be quiet for
@@ -311,10 +316,10 @@ CompatRunCommand(ClientData cmdp, ClientData gnp)
return (0);
}
- if (*cp != '\0') {
+ if (useShell) {
/*
- * If *cp isn't the null character, we hit a "meta" character and
- * need to pass the command off to the shell.
+ * We need to pass the command off to the shell, typically
+ * because the command contains a "meta" character.
*/
static const char *shargv[4];
@@ -331,12 +336,14 @@ CompatRunCommand(ClientData cmdp, ClientData gnp)
av = shargv;
argc = 0;
bp = NULL;
+ mav = NULL;
} else {
/*
* No meta-characters, so no need to exec a shell. Break the command
* into words to form an argument vector we can execute.
*/
- av = (const char **)brk_string(cmd, &argc, TRUE, &bp);
+ mav = brk_string(cmd, &argc, TRUE, &bp);
+ av = (const char **)mav;
}
local = TRUE;
@@ -350,6 +357,7 @@ CompatRunCommand(ClientData cmdp, ClientData gnp)
}
if (cpid == 0) {
Check_Cwd(av);
+ Var_ExportVars();
if (local)
(void)execvp(av[0], (char *const *)UNCONST(av));
else
@@ -357,11 +365,11 @@ CompatRunCommand(ClientData cmdp, ClientData gnp)
execError("exec", av[0]);
_exit(1);
}
- if (bp) {
- free(av);
+ if (mav)
+ free(mav);
+ if (bp)
free(bp);
- }
- Lst_Replace(cmdNode, (ClientData) NULL);
+ Lst_Replace(cmdNode, NULL);
/*
* The child is off and running. Now all we can do is wait...
@@ -381,21 +389,21 @@ CompatRunCommand(ClientData cmdp, ClientData gnp)
status = WEXITSTATUS(reason); /* exited */
if (status != 0) {
if (DEBUG(ERROR)) {
- printf("\n*** Failed target: %s\n*** Failed command: ",
+ fprintf(debug_file, "\n*** Failed target: %s\n*** Failed command: ",
gn->name);
for (cp = cmd; *cp; ) {
if (isspace((unsigned char)*cp)) {
- putchar(' ');
+ fprintf(debug_file, " ");
while (isspace((unsigned char)*cp))
cp++;
} else {
- putchar(*cp);
+ fprintf(debug_file, "%c", *cp);
cp++;
}
}
- printf("\n");
+ fprintf(debug_file, "\n");
}
- printf("*** Error code %d", status);
+ fprintf(debug_file, "*** Error code %d", status);
}
} else {
status = WTERMSIG(reason); /* signaled */
@@ -471,7 +479,7 @@ Compat_Make(ClientData gnp, ClientData pgnp)
gn->made = BEINGMADE;
if ((gn->type & OP_MADE) == 0)
Suff_FindDeps(gn);
- Lst_ForEach(gn->children, Compat_Make, (ClientData)gn);
+ Lst_ForEach(gn->children, Compat_Make, gn);
if ((gn->flags & REMAKE) == 0) {
gn->made = ABORTED;
pgn->flags &= ~REMAKE;
@@ -492,16 +500,16 @@ Compat_Make(ClientData gnp, ClientData pgnp)
* Make_OODate function.
*/
if (DEBUG(MAKE)) {
- printf("Examining %s...", gn->name);
+ fprintf(debug_file, "Examining %s...", gn->name);
}
if (! Make_OODate(gn)) {
gn->made = UPTODATE;
if (DEBUG(MAKE)) {
- printf("up-to-date.\n");
+ fprintf(debug_file, "up-to-date.\n");
}
goto cohorts;
} else if (DEBUG(MAKE)) {
- printf("out-of-date.\n");
+ fprintf(debug_file, "out-of-date.\n");
}
/*
@@ -537,7 +545,7 @@ Compat_Make(ClientData gnp, ClientData pgnp)
*/
if (!touchFlag || (gn->type & OP_MAKE)) {
curTarg = gn;
- Lst_ForEach(gn->commands, CompatRunCommand, (ClientData)gn);
+ Lst_ForEach(gn->commands, CompatRunCommand, gn);
curTarg = NILGNODE;
} else {
Job_Touch(gn, gn->type & OP_SILENT);
@@ -663,7 +671,7 @@ Compat_Run(Lst targs)
* Expand .USE nodes right now, because they can modify the structure
* of the tree.
*/
- Lst_Destroy(Make_ExpandUse(targs), NOFREE);
+ Make_ExpandUse(targs);
/*
* For each entry in the list of targets to create, call Compat_Make on
diff --git a/devel/bmake/files/cond.c b/devel/bmake/files/cond.c
index e9dae8dba84..93d35b8eb77 100644
--- a/devel/bmake/files/cond.c
+++ b/devel/bmake/files/cond.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cond.c,v 1.2 2007/10/26 09:41:49 rillig Exp $ */
+/* $NetBSD: cond.c,v 1.3 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: cond.c,v 1.2 2007/10/26 09:41:49 rillig Exp $";
+static char rcsid[] = "$NetBSD: cond.c,v 1.3 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)cond.c 8.2 (Berkeley) 1/2/94";
#else
-__RCSID("$NetBSD: cond.c,v 1.2 2007/10/26 09:41:49 rillig Exp $");
+__RCSID("$NetBSD: cond.c,v 1.3 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -152,17 +152,17 @@ static Token CondT(Boolean);
static Token CondF(Boolean);
static Token CondE(Boolean);
-static struct If {
+static const struct If {
const char *form; /* Form of if */
int formlen; /* Length of form */
Boolean doNot; /* TRUE if default function should be negated */
Boolean (*defProc)(int, char *); /* Default function to apply */
} ifs[] = {
- { "ifdef", 5, FALSE, CondDoDefined },
- { "ifndef", 6, TRUE, CondDoDefined },
- { "ifmake", 6, FALSE, CondDoMake },
- { "ifnmake", 7, TRUE, CondDoMake },
- { "if", 2, FALSE, CondDoDefined },
+ { "def", 3, FALSE, CondDoDefined },
+ { "ndef", 4, TRUE, CondDoDefined },
+ { "make", 4, FALSE, CondDoMake },
+ { "nmake", 5, TRUE, CondDoMake },
+ { "", 0, FALSE, CondDoDefined },
{ NULL, 0, FALSE, NULL }
};
@@ -172,14 +172,8 @@ static char *condExpr; /* The expression to parse */
static Token condPushBack=None; /* Single push-back token used in
* parsing */
-#define MAXIF 64 /* greatest depth of #if'ing */
-
-static Boolean finalElse[MAXIF+1][MAXIF+1]; /* Seen final else (stack) */
-static Boolean condStack[MAXIF]; /* Stack of conditionals's values */
-static int condTop = MAXIF; /* Top-most conditional */
-static int skipIfLevel=0; /* Depth of skipped conditionals */
-static Boolean skipLine = FALSE; /* Whether the parse module is skipping
- * lines */
+static unsigned int cond_depth = 0; /* current .if nesting level */
+static unsigned int cond_min_depth = 0; /* depth at makefile open */
static int
istoken(const char *str, const char *tok, size_t len)
@@ -251,7 +245,7 @@ CondGetArg(char **linePtr, char **argPtr, const char *func, Boolean parens)
* than hitting the user with a warning message every time s/he uses
* the word 'make' or 'defined' at the beginning of a symbol...
*/
- *argPtr = cp;
+ *argPtr = NULL;
return (0);
}
@@ -275,14 +269,12 @@ CondGetArg(char **linePtr, char **argPtr, const char *func, Boolean parens)
*/
char *cp2;
int len;
- Boolean doFree;
-
- cp2 = Var_Parse(cp, VAR_CMD, TRUE, &len, &doFree);
+ void *freeIt;
+ cp2 = Var_Parse(cp, VAR_CMD, TRUE, &len, &freeIt);
Buf_AddBytes(buf, strlen(cp2), (Byte *)cp2);
- if (doFree) {
- free(cp2);
- }
+ if (freeIt)
+ free(freeIt);
cp += len;
} else {
Buf_AddByte(buf, (Byte)*cp);
@@ -384,7 +376,7 @@ CondDoMake(int argLen, char *arg)
Boolean result;
arg[argLen] = '\0';
- if (Lst_Find(create, (ClientData)arg, CondStrMatch) == NILLNODE) {
+ if (Lst_Find(create, arg, CondStrMatch) == NILLNODE) {
result = FALSE;
} else {
result = TRUE;
@@ -422,6 +414,10 @@ CondDoExists(int argLen, char *arg)
result = FALSE;
}
arg[argLen] = savec;
+ if (DEBUG(COND)) {
+ fprintf(debug_file, "exists(%s) result is \"%s\"\n",
+ arg, path ? path : "");
+ }
return (result);
}
@@ -540,7 +536,7 @@ CondCvtArg(char *str, double *value)
* string. This is called for the lhs and rhs of string compares.
*
* Results:
- * Sets doFree if needed,
+ * Sets freeIt if needed,
* Sets quoted if string was quoted,
* Returns NULL on error,
* else returns string - absent any quotes.
@@ -551,8 +547,9 @@ CondCvtArg(char *str, double *value)
*
*-----------------------------------------------------------------------
*/
+/* coverity:[+alloc : arg-*2] */
static char *
-CondGetString(Boolean doEval, Boolean *quoted, Boolean *doFree)
+CondGetString(Boolean doEval, Boolean *quoted, void **freeIt)
{
Buffer buf;
char *cp;
@@ -563,6 +560,7 @@ CondGetString(Boolean doEval, Boolean *quoted, Boolean *doFree)
buf = Buf_Init(0);
str = NULL;
+ *freeIt = NULL;
*quoted = qt = *condExpr == '"' ? 1 : 0;
if (qt)
condExpr++;
@@ -596,8 +594,12 @@ CondGetString(Boolean doEval, Boolean *quoted, Boolean *doFree)
case '$':
/* if we are in quotes, then an undefined variable is ok */
str = Var_Parse(condExpr, VAR_CMD, (qt ? 0 : doEval),
- &len, doFree);
+ &len, freeIt);
if (str == var_Error) {
+ if (*freeIt) {
+ free(*freeIt);
+ *freeIt = NULL;
+ }
/*
* Even if !doEval, we still report syntax errors, which
* is what getting var_Error back with !doEval means.
@@ -623,9 +625,10 @@ CondGetString(Boolean doEval, Boolean *quoted, Boolean *doFree)
for (cp = str; *cp; cp++) {
Buf_AddByte(buf, (Byte)*cp);
}
- if (*doFree)
- free(str);
- *doFree = FALSE;
+ if (*freeIt) {
+ free(*freeIt);
+ *freeIt = NULL;
+ }
str = NULL; /* not finished yet */
condExpr--; /* don't skip over next char */
break;
@@ -637,7 +640,7 @@ CondGetString(Boolean doEval, Boolean *quoted, Boolean *doFree)
got_str:
Buf_AddByte(buf, (Byte)'\0');
str = (char *)Buf_GetAll(buf, NULL);
- *doFree = TRUE;
+ *freeIt = str;
cleanup:
Buf_Destroy(buf, FALSE);
return str;
@@ -702,8 +705,8 @@ CondToken(Boolean doEval)
char *lhs;
char *rhs;
char *op;
- Boolean lhsFree;
- Boolean rhsFree;
+ void *lhsFree;
+ void *rhsFree;
Boolean lhsQuoted;
Boolean rhsQuoted;
@@ -717,8 +720,11 @@ CondToken(Boolean doEval)
*/
t = Err;
lhs = CondGetString(doEval, &lhsQuoted, &lhsFree);
- if (!lhs)
+ if (!lhs) {
+ if (lhsFree)
+ free(lhsFree);
return Err;
+ }
/*
* Skip whitespace to get to the operator
*/
@@ -760,8 +766,13 @@ CondToken(Boolean doEval)
goto error;
}
rhs = CondGetString(doEval, &rhsQuoted, &rhsFree);
- if (!rhs)
+ if (!rhs) {
+ if (lhsFree)
+ free(lhsFree);
+ if (rhsFree)
+ free(rhsFree);
return Err;
+ }
do_compare:
if (rhsQuoted || lhsQuoted) {
do_string_compare:
@@ -772,7 +783,7 @@ do_string_compare:
}
if (DEBUG(COND)) {
- printf("lhs = \"%s\", rhs = \"%s\", op = %.2s\n",
+ fprintf(debug_file, "lhs = \"%s\", rhs = \"%s\", op = %.2s\n",
lhs, rhs, op);
}
/*
@@ -799,7 +810,7 @@ do_string_compare:
goto do_string_compare;
if (DEBUG(COND)) {
- printf("left = %f, right = %f, op = %.2s\n", left,
+ fprintf(debug_file, "left = %f, right = %f, op = %.2s\n", left,
right, op);
}
switch(op[0]) {
@@ -837,16 +848,16 @@ do_string_compare:
}
error:
if (lhsFree)
- free(lhs);
+ free(lhsFree);
if (rhsFree)
- free(rhs);
+ free(rhsFree);
break;
}
default: {
Boolean (*evalProc)(int, char *);
Boolean invert = FALSE;
- char *arg;
- int arglen;
+ char *arg = NULL;
+ int arglen = 0;
if (istoken(condExpr, "defined", 7)) {
/*
@@ -892,26 +903,28 @@ error:
* Use Var_Parse to parse the spec in parens and return
* True if the resulting string is empty.
*/
- int length;
- Boolean doFree;
+ int did_warn, length;
+ void *freeIt;
char *val;
condExpr += 5;
- if (condExpr[0] != '(')
- Parse_Error(PARSE_WARNING, "Extra characters after \"empty\"");
- for (arglen = 0;
- condExpr[arglen] != '(' && condExpr[arglen] != '\0';
- arglen += 1)
- continue;
+ did_warn = 0;
+ for (arglen = 0; condExpr[arglen] != '\0'; arglen += 1) {
+ if (condExpr[arglen] == '(')
+ break;
+ if (!isspace((unsigned char)condExpr[arglen]) &&
+ !did_warn) {
+
+ Parse_Error(PARSE_WARNING,
+ "Extra characters after \"empty\"");
+ did_warn = 1;
+ }
+ }
if (condExpr[arglen] != '\0') {
- /* Var_Parse usually gets a string like "$(varname)".
- * It doesn't care about the first character, so
- * we can pass anything here, even the 'y' of "empty".
- */
val = Var_Parse(&condExpr[arglen - 1], VAR_CMD,
- FALSE, &length, &doFree);
+ FALSE, &length, &freeIt);
if (val == var_Error) {
t = Err;
} else {
@@ -924,8 +937,8 @@ error:
continue;
t = (*p == '\0') ? True : False;
}
- if (doFree) {
- free(val);
+ if (freeIt) {
+ free(freeIt);
}
/*
* Advance condExpr to beyond the closing ). Note that
@@ -985,7 +998,8 @@ error:
t = (!doEval || (* evalProc) (arglen, arg) ?
(invert ? False : True) :
(invert ? True : False));
- free(arg);
+ if (arg)
+ free(arg);
break;
}
}
@@ -1205,7 +1219,7 @@ err:
* Cond_Eval --
* Evaluate the conditional in the passed line. The line
* looks like this:
- * #<cond-type> <expr>
+ * .<cond-type> <expr>
* where <cond-type> is any of if, ifmake, ifnmake, ifdef,
* ifndef, elif, elifmake, elifnmake, elifdef, elifndef
* and <expr> consists of &&, ||, !, make(target), defined(variable)
@@ -1222,157 +1236,147 @@ err:
* Side Effects:
* None.
*
+ * Note that the states IF_ACTIVE and ELSE_ACTIVE are only different in order
+ * to detect splurious .else lines (as are SKIP_TO_ELSE and SKIP_TO_ENDIF)
+ * otherwise .else could be treated as '.elif 1'.
+ *
*-----------------------------------------------------------------------
*/
int
Cond_Eval(char *line)
{
- struct If *ifp;
- Boolean isElse;
- Boolean value = FALSE;
+ #define MAXIF 64 /* maximum depth of .if'ing */
+ enum if_states {
+ IF_ACTIVE, /* .if or .elif part active */
+ ELSE_ACTIVE, /* .else part active */
+ SEARCH_FOR_ELIF, /* searching for .elif/else to execute */
+ SKIP_TO_ELSE, /* has been true, but not seen '.else' */
+ SKIP_TO_ENDIF /* nothing else to execute */
+ };
+ static enum if_states cond_state[MAXIF + 1] = { IF_ACTIVE };
+
+ const struct If *ifp;
+ Boolean isElif;
+ Boolean value;
int level; /* Level at which to report errors. */
+ enum if_states state;
level = PARSE_FATAL;
- for (line++; *line == ' ' || *line == '\t'; line++) {
+ /* skip leading character (the '.') and any whitespace */
+ for (line++; *line == ' ' || *line == '\t'; line++)
continue;
- }
- /*
- * Find what type of if we're dealing with. The result is left
- * in ifp and isElse is set TRUE if it's an elif line.
- */
- if (line[0] == 'e' && line[1] == 'l') {
- line += 2;
- isElse = TRUE;
- } else if (istoken(line, "endif", 5)) {
- /*
- * End of a conditional section. If skipIfLevel is non-zero, that
- * conditional was skipped, so lines following it should also be
- * skipped. Hence, we return COND_SKIP. Otherwise, the conditional
- * was read so succeeding lines should be parsed (think about it...)
- * so we return COND_PARSE, unless this endif isn't paired with
- * a decent if.
- */
- finalElse[condTop][skipIfLevel] = FALSE;
- if (skipIfLevel != 0) {
- skipIfLevel -= 1;
- return (COND_SKIP);
- } else {
- if (condTop == MAXIF) {
+ /* Find what type of if we're dealing with. */
+ if (line[0] == 'e') {
+ if (line[1] != 'l') {
+ if (!istoken(line + 1, "ndif", 4))
+ return COND_INVALID;
+ /* End of conditional section */
+ if (cond_depth == cond_min_depth) {
Parse_Error(level, "if-less endif");
- return (COND_INVALID);
- } else {
- skipLine = FALSE;
- condTop += 1;
- return (COND_PARSE);
+ return COND_PARSE;
}
+ /* Return state for previous conditional */
+ cond_depth--;
+ return cond_state[cond_depth] <= ELSE_ACTIVE ? COND_PARSE : COND_SKIP;
}
- } else {
- isElse = FALSE;
- }
+
+ /* Quite likely this is 'else' or 'elif' */
+ line += 2;
+ if (istoken(line, "se", 2)) {
+ /* It is else... */
+ if (cond_depth == cond_min_depth) {
+ Parse_Error(level, "if-less else");
+ return COND_INVALID;
+ }
+
+ state = cond_state[cond_depth];
+ switch (state) {
+ case SEARCH_FOR_ELIF:
+ state = ELSE_ACTIVE;
+ break;
+ case ELSE_ACTIVE:
+ case SKIP_TO_ENDIF:
+ Parse_Error(PARSE_WARNING, "extra else");
+ /* FALLTHROUGH */
+ default:
+ case IF_ACTIVE:
+ case SKIP_TO_ELSE:
+ state = SKIP_TO_ENDIF;
+ break;
+ }
+ cond_state[cond_depth] = state;
+ return state <= ELSE_ACTIVE ? COND_PARSE : COND_SKIP;
+ }
+ /* Assume for now it is an elif */
+ isElif = TRUE;
+ } else
+ isElif = FALSE;
+
+ if (line[0] != 'i' || line[1] != 'f')
+ /* Not an ifxxx or elifxxx line */
+ return COND_INVALID;
/*
* Figure out what sort of conditional it is -- what its default
* function is, etc. -- by looking in the table of valid "ifs"
*/
- for (ifp = ifs; ifp->form != NULL; ifp++) {
+ line += 2;
+ for (ifp = ifs; ; ifp++) {
+ if (ifp->form == NULL)
+ return COND_INVALID;
if (istoken(ifp->form, line, ifp->formlen)) {
+ line += ifp->formlen;
break;
}
}
- if (ifp->form == NULL) {
- /*
- * Nothing fit. If the first word on the line is actually
- * "else", it's a valid conditional whose value is the inverse
- * of the previous if we parsed.
- */
- if (isElse && istoken(line, "se", 2)) {
- if (finalElse[condTop][skipIfLevel]) {
- Parse_Error(PARSE_WARNING, "extra else");
- } else {
- finalElse[condTop][skipIfLevel] = TRUE;
- }
- if (condTop == MAXIF) {
- Parse_Error(level, "if-less else");
- return (COND_INVALID);
- } else if (skipIfLevel == 0) {
- value = !condStack[condTop];
- } else {
- return (COND_SKIP);
- }
- } else {
- /*
- * Not a valid conditional type. No error...
- */
- return (COND_INVALID);
+ /* Now we know what sort of 'if' it is... */
+ state = cond_state[cond_depth];
+
+ if (isElif) {
+ if (cond_depth == cond_min_depth) {
+ Parse_Error(level, "if-less elif");
+ return COND_INVALID;
+ }
+ if (state == SKIP_TO_ENDIF || state == ELSE_ACTIVE)
+ Parse_Error(PARSE_WARNING, "extra elif");
+ if (state != SEARCH_FOR_ELIF) {
+ /* Either just finished the 'true' block, or already SKIP_TO_ELSE */
+ cond_state[cond_depth] = SKIP_TO_ELSE;
+ return COND_SKIP;
}
} else {
- if (isElse) {
- if (condTop == MAXIF) {
- Parse_Error(level, "if-less elif");
- return (COND_INVALID);
- } else if (skipIfLevel != 0) {
- /*
- * If skipping this conditional, just ignore the whole thing.
- * If we don't, the user might be employing a variable that's
- * undefined, for which there's an enclosing ifdef that
- * we're skipping...
- */
- return(COND_SKIP);
- }
- } else if (skipLine) {
- /*
- * Don't even try to evaluate a conditional that's not an else if
- * we're skipping things...
- */
- skipIfLevel += 1;
- if (skipIfLevel >= MAXIF) {
- Parse_Error(PARSE_FATAL, "Too many nested if's. %d max.", MAXIF);
- return (COND_INVALID);
- }
- finalElse[condTop][skipIfLevel] = FALSE;
- return(COND_SKIP);
+ if (cond_depth >= MAXIF) {
+ Parse_Error(PARSE_FATAL, "Too many nested if's. %d max.", MAXIF);
+ return COND_INVALID;
+ }
+ cond_depth++;
+ if (state > ELSE_ACTIVE) {
+ /* If we aren't parsing the data, treat as always false */
+ cond_state[cond_depth] = SKIP_TO_ELSE;
+ return COND_SKIP;
}
+ }
- /*
- * Initialize file-global variables for parsing
- */
- condDefProc = ifp->defProc;
- condInvert = ifp->doNot;
+ /* Initialize file-global variables for parsing the expression */
+ condDefProc = ifp->defProc;
+ condInvert = ifp->doNot;
- line += ifp->formlen;
- if (Cond_EvalExpression(0, line, &value, 1) == COND_INVALID)
- return COND_INVALID;
- }
- if (!isElse) {
- condTop -= 1;
- finalElse[condTop][skipIfLevel] = FALSE;
- } else if ((skipIfLevel != 0) || condStack[condTop]) {
- /*
- * If this is an else-type conditional, it should only take effect
- * if its corresponding if was evaluated and FALSE. If its if was
- * TRUE or skipped, we return COND_SKIP (and start skipping in case
- * we weren't already), leaving the stack unmolested so later elif's
- * don't screw up...
- */
- skipLine = TRUE;
- return (COND_SKIP);
+ /* And evaluate the conditional expresssion */
+ if (Cond_EvalExpression(0, line, &value, 1) == COND_INVALID) {
+ /* Although we get make to reprocess the line, set a state */
+ cond_state[cond_depth] = SEARCH_FOR_ELIF;
+ return COND_INVALID;
}
- if (condTop < 0) {
- /*
- * This is the one case where we can definitely proclaim a fatal
- * error. If we don't, we're hosed.
- */
- Parse_Error(PARSE_FATAL, "Too many nested if's. %d max.", MAXIF);
- return (COND_INVALID);
- } else {
- condStack[condTop] = value;
- skipLine = !value;
- return (value ? COND_PARSE : COND_SKIP);
+ if (!value) {
+ cond_state[cond_depth] = SEARCH_FOR_ELIF;
+ return COND_SKIP;
}
+ cond_state[cond_depth] = IF_ACTIVE;
+ return COND_PARSE;
}
@@ -1391,11 +1395,24 @@ Cond_Eval(char *line)
*-----------------------------------------------------------------------
*/
void
-Cond_End(void)
+Cond_restore_depth(unsigned int saved_depth)
{
- if (condTop != MAXIF) {
- Parse_Error(PARSE_FATAL, "%d open conditional%s", MAXIF-condTop,
- MAXIF-condTop == 1 ? "" : "s");
+ int open_conds = cond_depth - cond_min_depth;
+
+ if (open_conds != 0 || saved_depth > cond_depth) {
+ Parse_Error(PARSE_FATAL, "%d open conditional%s", open_conds,
+ open_conds == 1 ? "" : "s");
+ cond_depth = cond_min_depth;
}
- condTop = MAXIF;
+
+ cond_min_depth = saved_depth;
+}
+
+unsigned int
+Cond_save_depth(void)
+{
+ int depth = cond_min_depth;
+
+ cond_min_depth = cond_depth;
+ return depth;
}
diff --git a/devel/bmake/files/config.h.in b/devel/bmake/files/config.h.in
index 83eed003aaf..02ff11323a2 100644
--- a/devel/bmake/files/config.h.in
+++ b/devel/bmake/files/config.h.in
@@ -1,19 +1,10 @@
/* config.h.in. Generated from configure.in by autoheader. */
-/* Path to csh */
-#undef DEFAULT_CSH
-
-/* Path to ksh */
-#undef DEFAULT_KSH
-
-/* Path to sh */
-#undef DEFAULT_SH
-
-/* Default path for sys.mk */
-#undef DEFAULT_SYS_PATH
+/* Path of default shell */
+#undef DEFSHELL_CUSTOM
/* Shell spec to use by default */
-#undef DEFSHELL
+#undef DEFSHELL_INDEX
/* Define to 1 if you have the <ar.h> header file. */
#undef HAVE_AR_H
@@ -32,6 +23,12 @@
/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
#undef HAVE_DOPRNT
+/* Define to 1 if you have the `emalloc' function. */
+#undef HAVE_EMALLOC
+
+/* Define to 1 if you have the `estrndup' function. */
+#undef HAVE_ESTRNDUP
+
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
@@ -110,6 +107,9 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the `strndup' function. */
+#undef HAVE_STRNDUP
+
/* Define to 1 if you have the `strtod' function. */
#undef HAVE_STRTOD
@@ -155,6 +155,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the `unsetenv' function. */
+#undef HAVE_UNSETENV
+
/* Define to 1 if you have the <utime.h> header file. */
#undef HAVE_UTIME_H
@@ -245,13 +248,13 @@
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
-/* Define to `long int' if <sys/types.h> does not define. */
+/* Define to `long' if <sys/types.h> does not define. */
#undef off_t
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
-/* Define to `unsigned int' if <sys/types.h> does not define. */
+/* Define to `unsigned' if <sys/types.h> does not define. */
#undef size_t
/* Define as `fork' if `vfork' does not work. */
diff --git a/devel/bmake/files/configure b/devel/bmake/files/configure
index 413340cf104..9f16efbc2f6 100755
--- a/devel/bmake/files/configure
+++ b/devel/bmake/files/configure
@@ -1,100 +1,36 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61.
+# Generated by GNU Autoconf 2.57.
#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
+# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# 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
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
fi
# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
fi
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
+$as_unset ENV MAIL MAILPATH
PS1='$ '
PS2='> '
PS4='+ '
@@ -105,22 +41,21 @@ for as_var in \
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ $as_unset $as_var
fi
done
# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
+if expr a : '\(a\)' >/dev/null 2>&1; then
as_expr=expr
else
as_expr=false
fi
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
@@ -128,447 +63,206 @@ fi
# Name of the executable.
-as_me=`$as_basename -- "$0" ||
+as_me=`$as_basename "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
-# CDPATH.
-$as_unset CDPATH
-
-
-if test "x$CONFIG_SHELL" = x; then
- if (eval ":") 2>/dev/null; then
- as_have_required=yes
-else
- as_have_required=no
-fi
- if test $as_have_required = yes && (eval ":
-(as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
+# PATH needs CR, and LINENO needs CR and PATH.
+# 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
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
fi
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-test \$exitcode = 0) || { (exit 1); exit 1; }
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
-(
- as_lineno_1=\$LINENO
- as_lineno_2=\$LINENO
- test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
- test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
-") 2> /dev/null; then
- :
-else
- as_candidate_shells=
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- case $as_dir in
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
/*)
- for as_base in sh bash ksh sh5; do
- as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
- done;;
- esac
-done
-IFS=$as_save_IFS
-
-
- for as_shell in $as_candidate_shells $SHELL; do
- # Try only shells that exist, to save several forks.
- if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
- { ("$as_shell") 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-_ASEOF
-}; then
- CONFIG_SHELL=$as_shell
- as_have_required=yes
- if { "$as_shell" 2> /dev/null <<\_ASEOF
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-:
-(as_func_return () {
- (exit $1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = "$1" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test $exitcode = 0) || { (exit 1); exit 1; }
-
-(
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
-
-_ASEOF
-}; then
- break
-fi
-
-fi
-
- done
-
- if test "x$CONFIG_SHELL" != x; then
- for as_var in BASH_ENV ENV
- do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
- done
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
-fi
-
-
- if test $as_have_required = no; then
- echo This script requires a shell more modern than all the
- echo shells that I found on your system. Please install a
- echo modern shell, or manually run the script under such a
- echo shell if you do have one.
- { (exit 1); exit 1; }
-fi
-
-
-fi
-
-fi
-
-
-
-(eval "as_func_return () {
- (exit \$1)
-}
-as_func_success () {
- as_func_return 0
-}
-as_func_failure () {
- as_func_return 1
-}
-as_func_ret_success () {
- return 0
-}
-as_func_ret_failure () {
- return 1
-}
-
-exitcode=0
-if as_func_success; then
- :
-else
- exitcode=1
- echo as_func_success failed.
-fi
-
-if as_func_failure; then
- exitcode=1
- echo as_func_failure succeeded.
-fi
-
-if as_func_ret_success; then
- :
-else
- exitcode=1
- echo as_func_ret_success failed.
-fi
-
-if as_func_ret_failure; then
- exitcode=1
- echo as_func_ret_failure succeeded.
-fi
-
-if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
- :
-else
- exitcode=1
- echo positional parameters were not saved.
-fi
-
-test \$exitcode = 0") || {
- echo No shell found that supports shell functions.
- echo Please tell autoconf@gnu.org about your system,
- echo including any error possibly output before this
- echo message
-}
-
-
-
+ if ("$as_dir/$as_base" -c '
as_lineno_1=$LINENO
as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
# Create $as_me.lineno as a copy of $as_myself, but with $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
t loop
- s/-\n.*//
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
+ chmod +x $as_me.lineno ||
{ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
# Exit status is that of the last command.
exit
}
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
+if expr a : '\(a\)' >/dev/null 2>&1; then
as_expr=expr
else
as_expr=false
fi
rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ # 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$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
+rm -f conf$$ conf$$.exe conf$$.file
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
- test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
-exec 7<&0 </dev/null 6>&1
# 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
-ac_clean_files=
ac_config_libobj_dir=.
-LIBOBJS=
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}
+
# Identity of this package.
PACKAGE_NAME=
PACKAGE_TARNAME=
@@ -580,114 +274,42 @@ ac_unique_file="makefile.boot.in"
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
-#ifdef HAVE_SYS_TYPES_H
+#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
-#ifdef HAVE_SYS_STAT_H
+#if HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
-#ifdef STDC_HEADERS
+#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
-# ifdef HAVE_STDLIB_H
+# if HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif
-#ifdef HAVE_STRING_H
-# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#endif
-#ifdef HAVE_STRINGS_H
+#if HAVE_STRINGS_H
# include <strings.h>
#endif
-#ifdef HAVE_INTTYPES_H
+#if HAVE_INTTYPES_H
# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
#endif
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
-#ifdef HAVE_UNISTD_H
+#if HAVE_UNISTD_H
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL
-PATH_SEPARATOR
-PACKAGE_NAME
-PACKAGE_TARNAME
-PACKAGE_VERSION
-PACKAGE_STRING
-PACKAGE_BUGREPORT
-exec_prefix
-prefix
-program_transform_name
-bindir
-sbindir
-libexecdir
-datarootdir
-datadir
-sysconfdir
-sharedstatedir
-localstatedir
-includedir
-oldincludedir
-docdir
-infodir
-htmldir
-dvidir
-pdfdir
-psdir
-libdir
-localedir
-mandir
-DEFS
-ECHO_C
-ECHO_N
-ECHO_T
-LIBS
-build_alias
-host_alias
-target_alias
-DEFAULT_CSH
-DEFAULT_KSH
-DEFAULT_SH
-CC
-CFLAGS
-LDFLAGS
-CPPFLAGS
-ac_ct_CC
-EXEEXT
-OBJEXT
-CPP
-GREP
-EGREP
-INSTALL_PROGRAM
-INSTALL_SCRIPT
-INSTALL_DATA
-ac_exe_suffix
-LIBOBJS
-DEFAULT_SYS_PATH
-machine
-force_machine
-machine_arch
-mksrc
-INSTALL
-GCC
-diff_u
-LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA ac_exe_suffix LIBOBJS machine force_machine machine_arch mksrc default_sys_path INSTALL GCC diff_u LTLIBOBJS'
ac_subst_files=''
- ac_precious_vars='build_alias
-host_alias
-target_alias
-CC
-CFLAGS
-LDFLAGS
-LIBS
-CPPFLAGS
-CPP'
-
# Initialize some variables set by options.
ac_init_help=
@@ -714,48 +336,34 @@ x_libraries=NONE
# 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.
-# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
-datarootdir='${prefix}/share'
-datadir='${datarootdir}'
+datadir='${prefix}/share'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE}'
-infodir='${datarootdir}/info'
-htmldir='${docdir}'
-dvidir='${docdir}'
-pdfdir='${docdir}'
-psdir='${docdir}'
-libdir='${exec_prefix}/lib'
-localedir='${datarootdir}/locale'
-mandir='${datarootdir}/man'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
ac_prev=
-ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
- eval $ac_prev=\$ac_option
+ eval "$ac_prev=\$ac_option"
ac_prev=
continue
fi
- case $ac_option in
- *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
- *) ac_optarg=yes ;;
- esac
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
# Accept the important Cygnus configure options, so we can diagnose typos.
- case $ac_dashdash$ac_option in
- --)
- ac_dashdash=yes ;;
+ case $ac_option in
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
@@ -777,45 +385,33 @@ do
--config-cache | -C)
cache_file=config.cache ;;
- -datadir | --datadir | --datadi | --datad)
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=*)
+ -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 &&
+ 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 ;;
-
- -docdir | --docdir | --docdi | --doc | --do)
- ac_prev=docdir ;;
- -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
- docdir=$ac_optarg ;;
-
- -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
- ac_prev=dvidir ;;
- -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
- dvidir=$ac_optarg ;;
+ 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 &&
+ 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=\$ac_optarg ;;
+ 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- \
@@ -842,12 +438,6 @@ do
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
- -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
- ac_prev=htmldir ;;
- -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
- | --ht=*)
- htmldir=$ac_optarg ;;
-
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
@@ -872,16 +462,13 @@ do
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
- -localedir | --localedir | --localedi | --localed | --locale)
- ac_prev=localedir ;;
- -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
- localedir=$ac_optarg ;;
-
-localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst | --locals)
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -946,16 +533,6 @@ do
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
- -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
- ac_prev=pdfdir ;;
- -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
- pdfdir=$ac_optarg ;;
-
- -psdir | --psdir | --psdi | --psd | --ps)
- ac_prev=psdir ;;
- -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
- psdir=$ac_optarg ;;
-
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
@@ -1008,20 +585,24 @@ do
-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 &&
+ 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=\$ac_optarg ;;
+ 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 &&
+ 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 ;;
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
--x)
# Obsolete; use --with-x.
@@ -1052,7 +633,8 @@ Try \`$0 --help' for more information." >&2
expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid variable name: $ac_envvar" >&2
{ (exit 1); exit 1; }; }
- eval $ac_envvar=\$ac_optarg
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
export $ac_envvar ;;
*)
@@ -1072,19 +654,27 @@ if test -n "$ac_prev"; then
{ (exit 1); exit 1; }; }
fi
-# Be sure to have absolute directory names.
-for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
- datadir sysconfdir sharedstatedir localstatedir includedir \
- oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
do
- eval ac_val=\$$ac_var
+ eval ac_val=$`echo $ac_var`
case $ac_val in
- [\\/$]* | ?:[\\/]* ) continue;;
- NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
+
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
esac
- { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; }
done
# There might be people who depend on the old broken behavior: `$host'
@@ -1111,76 +701,74 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
-ac_pwd=`pwd` && test -n "$ac_pwd" &&
-ac_ls_di=`ls -di .` &&
-ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
- { echo "$as_me: error: Working directory cannot be determined" >&2
- { (exit 1); exit 1; }; }
-test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
- { echo "$as_me: error: pwd does not report name of working directory" >&2
- { (exit 1); exit 1; }; }
-
-
# 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 the parent directory.
- ac_confdir=`$as_dirname -- "$0" ||
+ # Try the directory containing this script, then its parent.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$0" : 'X\(//\)[^/]' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
srcdir=$ac_confdir
- if test ! -r "$srcdir/$ac_unique_file"; then
+ if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
-if test ! -r "$srcdir/$ac_unique_file"; then
- test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+if test ! -r $srcdir/$ac_unique_file; then
+ if test "$ac_srcdir_defaulted" = yes; then
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
+ else
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
{ (exit 1); exit 1; }; }
+ fi
fi
-ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
-ac_abs_confdir=`(
- cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
{ (exit 1); exit 1; }; }
- pwd)`
-# When building in place, set srcdir=.
-if test "$ac_abs_confdir" = "$ac_pwd"; then
- srcdir=.
-fi
-# Remove unnecessary trailing slashes from srcdir.
-# Double slashes in file names in object file debugging info
-# mess up M-x gdb in Emacs.
-case $srcdir in
-*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
-esac
-for ac_var in $ac_precious_vars; do
- eval ac_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_env_${ac_var}_value=\$${ac_var}
- eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
- eval ac_cv_env_${ac_var}_value=\$${ac_var}
-done
+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.
@@ -1209,11 +797,14 @@ Configuration:
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
+_ACEOF
+
+ cat <<_ACEOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
+ [$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [PREFIX]
+ [PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
@@ -1226,22 +817,15 @@ Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
- --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
- --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
- --infodir=DIR info documentation [DATAROOTDIR/info]
- --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
- --mandir=DIR man documentation [DATAROOTDIR/man]
- --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
- --htmldir=DIR html documentation [DOCDIR]
- --dvidir=DIR dvi documentation [DOCDIR]
- --pdfdir=DIR pdf documentation [DOCDIR]
- --psdir=DIR ps documentation [DOCDIR]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
_ACEOF
cat <<\_ACEOF
@@ -1262,15 +846,15 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-defshell=SHELL explicitly set DEFSHELL to either /bin/sh or /bin/ksh
+ --with-defshell=SHELL use SHELL by default - must be sh compatible, use sh or ksh to pick the internal definitions
--with-machine=MACHINE explicitly set MACHINE
--with-force-machine=MACHINE set FORCE_MACHINE
--with-force-machine-arch=MACHINE set FORCE_MACHINE_ARCH
--with-machine_arch=MACHINE_ARCH explicitly set MACHINE_ARCH
- --with-default-sys-path=PATH:DIR:LIST use an explicit DEFAULT_SYS_PATH
+ --with-default-sys-path=PATH:DIR:LIST use an explicit _PATH_DEFSYSPATH
MAKESYSPATH is a ':' separated list of directories
that bmake will search for system .mk files.
- DEFAULT_SYS_PATH is its default value.
+ _PATH_DEFSYSPATH is its default value.
--with-path-objdirprefix=PATH override _PATH_OBJDIRPREFIX
--with-mksrc=PATH tell makefile.boot where to find mk src
@@ -1279,95 +863,94 @@ Some influential environment variables:
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
- LIBS libraries to pass to the linker, e.g. -l<library>
- CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
- you have headers in a nonstandard directory <include dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
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.
_ACEOF
-ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d "$ac_dir" || continue
+ test -d $ac_dir || continue
ac_builddir=.
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
+if test "$ac_dir" != .; then
ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
case $srcdir in
- .) # We are building in place.
+ .) # No --srcdir option. We are building in place.
ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
- cd "$ac_dir" || { ac_status=$?; continue; }
- # Check for guested configure.
- if test -f "$ac_srcdir/configure.gnu"; then
- echo &&
- $SHELL "$ac_srcdir/configure.gnu" --help=recursive
- elif test -f "$ac_srcdir/configure"; then
- echo &&
- $SHELL "$ac_srcdir/configure" --help=recursive
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
else
echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi || ac_status=$?
- cd "$ac_pwd" || { ac_status=$?; break; }
+ fi
+ cd $ac_popdir
done
fi
-test -n "$ac_init_help" && exit $ac_status
+test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
-configure
-generated by GNU Autoconf 2.61
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
- exit
+ exit 0
fi
-cat >config.log <<_ACEOF
+exec 5>config.log
+cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.61. Invocation command line was
+generated by GNU Autoconf 2.57. Invocation command line was
$ $0 $@
_ACEOF
-exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
@@ -1386,7 +969,7 @@ uname -v = `(uname -v) 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`
-/usr/bin/hostinfo = `(/usr/bin/hostinfo) 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`
@@ -1400,7 +983,6 @@ do
test -z "$as_dir" && as_dir=.
echo "PATH: $as_dir"
done
-IFS=$as_save_IFS
} >&5
@@ -1422,6 +1004,7 @@ _ACEOF
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
+ac_sep=
ac_must_keep_next=false
for ac_pass in 1 2
do
@@ -1432,7 +1015,7 @@ do
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
- *\'*)
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
@@ -1440,21 +1023,23 @@ do
2)
ac_configure_args1="$ac_configure_args1 '$ac_arg'"
if test $ac_must_keep_next = true; then
- ac_must_keep_next=false # Got value, back to normal.
+ ac_must_keep_next=false # Got value, back to normal.
else
- case $ac_arg in
- *=* | --config-cache | -C | -disable-* | --disable-* \
- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
- | -with-* | --with-* | -without-* | --without-* | --x)
- case "$ac_configure_args0 " in
- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
- esac
- ;;
- -* ) ac_must_keep_next=true ;;
- esac
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
fi
- ac_configure_args="$ac_configure_args '$ac_arg'"
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
;;
esac
done
@@ -1465,8 +1050,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_
# 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.
-# WARNING: Use '\'' to represent an apostrophe within the trap.
-# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
trap 'exit_status=$?
# Save into config.log some information that might help in debugging.
{
@@ -1479,34 +1064,20 @@ trap 'exit_status=$?
_ASBOX
echo
# The following way of writing the cache mishandles newlines in values,
-(
- for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
+{
(set) 2>&1 |
- case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
+ 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"
- ;; #(
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
*)
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
- esac |
- sort
-)
+ esac;
+}
echo
cat <<\_ASBOX
@@ -1517,28 +1088,22 @@ _ASBOX
echo
for ac_var in $ac_subst_vars
do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
done | sort
echo
if test -n "$ac_subst_files"; then
cat <<\_ASBOX
-## ------------------- ##
-## File substitutions. ##
-## ------------------- ##
+## ------------- ##
+## Output files. ##
+## ------------- ##
_ASBOX
echo
for ac_var in $ac_subst_files
do
- eval ac_val=\$$ac_var
- case $ac_val in
- *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
- esac
- echo "$ac_var='\''$ac_val'\''"
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
done | sort
echo
fi
@@ -1550,24 +1115,26 @@ _ASBOX
## ----------- ##
_ASBOX
echo
- cat confdefs.h
+ sed "/^$/d" confdefs.h | sort
echo
fi
test "$ac_signal" != 0 &&
echo "$as_me: caught signal $ac_signal"
echo "$as_me: exit $exit_status"
} >&5
- rm -f core *.core core.conftest.* &&
- rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+ rm -f core core.* *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
-' 0
+ ' 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 -f -r conftest* confdefs.h
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
# Predefined preprocessor variables.
@@ -1598,17 +1165,14 @@ _ACEOF
# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
-if test -n "$CONFIG_SITE"; then
- set x "$CONFIG_SITE"
-elif test "x$prefix" != xNONE; then
- set x "$prefix/share/config.site" "$prefix/etc/config.site"
-else
- set x "$ac_default_prefix/share/config.site" \
- "$ac_default_prefix/etc/config.site"
+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
-shift
-for ac_site_file
-do
+for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
{ echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
echo "$as_me: loading site script $ac_site_file" >&6;}
@@ -1624,8 +1188,8 @@ if test -r "$cache_file"; then
{ echo "$as_me:$LINENO: loading cache $cache_file" >&5
echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
- [\\/]* | ?:[\\/]* ) . "$cache_file";;
- *) . "./$cache_file";;
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
esac
fi
else
@@ -1637,11 +1201,12 @@ fi
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
-for ac_var in $ac_precious_vars; do
+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
+ 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:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
@@ -1654,19 +1219,20 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+ { echo "$as_me:$LINENO: 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:$LINENO: former value: $ac_old_val" >&5
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
echo "$as_me: former value: $ac_old_val" >&2;}
- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
echo "$as_me: current value: $ac_new_val" >&2;}
- ac_cache_corrupted=:
+ ac_cache_corrupted=:
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
@@ -1683,6 +1249,12 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov
{ (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
+
@@ -1699,45 +1271,29 @@ 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_config_headers="$ac_config_headers config.h"
+ ac_config_headers="$ac_config_headers config.h"
-DEFAULT_CSH=/bin/csh
-DEFAULT_KSH=/bin/ksh
-DEFAULT_SH=/bin/sh
-DEFSHELL=1
-# Check whether --with-defshell was given.
+# Check whether --with-defshell or --without-defshell was given.
if test "${with_defshell+set}" = set; then
- withval=$with_defshell; case "${withval}" in
+ withval="$with_defshell"
+ case "${withval}" in
yes) { { echo "$as_me:$LINENO: error: bad value ${withval} given for bmake DEFSHELL" >&5
echo "$as_me: error: bad value ${withval} given for bmake DEFSHELL" >&2;}
{ (exit 1); exit 1; }; } ;;
no) ;;
-*) case "$with_defshell" in
- */csh) DEFSHELL=0; DEFAULT_CSH=$with_defshell;; # kidding right?
- */sh) DEFSHELL=1; DEFAULT_SH=$with_defshell;;
- */ksh) DEFSHELL=2; DEFAULT_KSH=$with_defshell;;
- esac
+*) case "$with_defshell" in
+ sh) DEFSHELL_INDEX=DEFSHELL_INDEX_SH;; # it's the default anyway
+ ksh) DEFSHELL_INDEX=DEFSHELL_INDEX_KSH;;
+ csh) DEFSHELL_INDEX=DEFSHELL_INDEX_CSH;; # kidding right?
+ *) defshell_path=$with_defshell;; # better be sh compatible!
+ esac
;;
-esac
-fi
-
-
-cat >>confdefs.h <<_ACEOF
-#define DEFSHELL ${DEFSHELL}
-_ACEOF
-
-
-
-
+ esac
+fi;
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -1746,8 +1302,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: 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
@@ -1760,34 +1316,32 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
-IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$as_me:$LINENO: 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:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: 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
@@ -1800,51 +1354,36 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
-IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- 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.
+ 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:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: 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
@@ -1857,34 +1396,74 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
-IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$as_me:$LINENO: 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:$LINENO: 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
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: 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:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: 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
@@ -1898,7 +1477,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
@@ -1909,7 +1488,6 @@ do
fi
done
done
-IFS=$as_save_IFS
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
@@ -1927,23 +1505,22 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$as_me:$LINENO: 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.exe
+ 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:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: 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
@@ -1956,38 +1533,36 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
-IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- { echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6; }
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$as_me:$LINENO: 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.exe
+ 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:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: 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
@@ -2000,45 +1575,29 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
-IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6; }
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
test -n "$ac_ct_CC" && break
done
- if test "x$ac_ct_CC" = x; then
- CC=""
- else
- case $cross_compiling:$ac_tool_warned in
-yes:)
-{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&5
-echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
-whose name does not start with the host triplet. If you think this
-configuration is useful to you, please write to autoconf@gnu.org." >&2;}
-ac_tool_warned=yes ;;
-esac
- CC=$ac_ct_CC
- fi
+ CC=$ac_ct_CC
fi
fi
@@ -2051,40 +1610,27 @@ See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
# Provide some information about the compiler.
-echo "$as_me:$LINENO: checking for C compiler version" >&5
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
-{ (ac_try="$ac_compiler --version >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler --version >&5") 2>&5
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
-{ (ac_try="$ac_compiler -v >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -v >&5") 2>&5
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
-{ (ac_try="$ac_compiler -V >&5"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compiler -V >&5") 2>&5
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2104,77 +1650,47 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out"
# 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:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: 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[^ ]*//'`
-#
-# List of possible output files, starting from the most likely.
-# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
-# only as a last resort. b.out is created by i960 compilers.
-ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
-#
-# The IRIX 6 linker writes into existing files which may not be
-# executable, retaining their permissions. Remove them first so a
-# subsequent execution test works.
-ac_rmfiles=
-for ac_file in $ac_files
-do
- case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
- * ) ac_rmfiles="$ac_rmfiles $ac_file";;
- esac
-done
-rm -f $ac_rmfiles
-
-if { (ac_try="$ac_link_default"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link_default") 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
- # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile. We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
+ # 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.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
- ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
[ab].out )
- # We found the default executable, but exeext='' is most
- # certainly right.
- break;;
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
*.* )
- if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
- then :; else
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- fi
- # We set ac_cv_exeext here because the later test for it is not
- # safe: cross compilers may not add the suffix if given an `-o'
- # argument, so we may need to know it at that point already.
- # Even if this section looks crufty: it has the advantage of
- # actually working.
- break;;
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
* )
- break;;
+ break;;
esac
done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
-
else
- ac_file=''
-fi
-
-{ echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6; }
-if test -z "$ac_file"; then
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -2186,21 +1702,19 @@ See \`config.log' for more details." >&2;}
fi
ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
-# Check that the compiler produces executables we can run. If not, either
+# Check the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: 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'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
@@ -2219,27 +1733,22 @@ See \`config.log' for more details." >&2;}
fi
fi
fi
-{ echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
rm -f a.out a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-# Check that the compiler produces executables we can run. If not, either
+# Check the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
-{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6; }
-
-{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
@@ -2250,9 +1759,10 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- break;;
+ export ac_cv_exeext
+ break;;
* ) break;;
esac
done
@@ -2265,18 +1775,19 @@ See \`config.log' for more details." >&2;}
fi
rm -f conftest$ac_cv_exeext
-{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6; }
+echo "$as_me:$LINENO: 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:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $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 $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2292,20 +1803,14 @@ main ()
}
_ACEOF
rm -f conftest.o conftest.obj
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
- for ac_file in conftest.o conftest.obj conftest.*; do
- test -f "$ac_file" || continue;
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
@@ -2323,16 +1828,17 @@ fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-{ echo "$as_me:$LINENO: 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; }
+echo "$as_me:$LINENO: 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 $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2351,87 +1857,41 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_compiler_gnu=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_compiler_gnu=no
+ac_compiler_gnu=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
+echo "$as_me:$LINENO: 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
-{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
+CFLAGS="-g"
+echo "$as_me:$LINENO: 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
- ac_save_c_werror_flag=$ac_c_werror_flag
- ac_c_werror_flag=yes
- ac_cv_prog_cc_g=no
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_g=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- CFLAGS=""
- cat >conftest.$ac_ext <<_ACEOF
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2447,80 +1907,28 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_c_werror_flag=$ac_save_c_werror_flag
- CFLAGS="-g"
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-
-int
-main ()
-{
-
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_cv_prog_cc_g=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_prog_cc_g=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
- ac_c_werror_flag=$ac_save_c_werror_flag
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
+echo "$as_me:$LINENO: 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
@@ -2536,14 +1944,15 @@ else
CFLAGS=
fi
fi
-{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
-echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
-if test "${ac_cv_prog_cc_c89+set}" = set; then
+echo "$as_me:$LINENO: 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_c89=no
+ ac_cv_prog_cc_stdc=no
ac_save_CC=$CC
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2571,21 +1980,6 @@ static char *f (char * (*g) (char **, int), char **p, ...)
va_end (v);
return s;
}
-
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
- function prototypes and stuff, but not '\xHH' hex character constants.
- These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std is added to get
- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
- array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std. */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
-
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
- inside strings and character constants. */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
-
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
@@ -2600,57 +1994,168 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
return 0;
}
_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
- -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+# 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 { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_prog_cc_c89=$ac_arg
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
fi
-
-rm -f core conftest.err conftest.$ac_objext
- test "x$ac_cv_prog_cc_c89" != "xno" && break
+rm -f conftest.$ac_objext
done
-rm -f conftest.$ac_ext
+rm -f conftest.$ac_ext conftest.$ac_objext
CC=$ac_save_CC
fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
- x)
- { echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6; } ;;
- xno)
- { echo "$as_me:$LINENO: result: unsupported" >&5
-echo "${ECHO_T}unsupported" >&6; } ;;
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
*)
- CC="$CC $ac_cv_prog_cc_c89"
- { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
esac
+# 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:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ ''\
+ '#include <stdlib.h>' \
+ '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 $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' 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'
@@ -2663,8 +2168,8 @@ ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: 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=
@@ -2686,6 +2191,7 @@ do
# 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 $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2696,24 +2202,25 @@ cat >>conftest.$ac_ext <<_ACEOF
#else
# include <assert.h>
#endif
- Syntax error
+ Syntax error
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
+ (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
@@ -2722,12 +2229,12 @@ sed 's/^/| /' 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 nonexistent headers
+ # OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2735,22 +2242,23 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
+ (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
@@ -2761,7 +2269,6 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_preproc_ok=:
break
fi
-
rm -f conftest.err conftest.$ac_ext
done
@@ -2779,8 +2286,8 @@ fi
else
ac_cv_prog_CPP=$CPP
fi
-{ echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6; }
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
@@ -2791,6 +2298,7 @@ do
# 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 $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2801,24 +2309,25 @@ cat >>conftest.$ac_ext <<_ACEOF
#else
# include <assert.h>
#endif
- Syntax error
+ Syntax error
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
+ (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
@@ -2827,12 +2336,12 @@ sed 's/^/| /' 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 nonexistent headers
+ # OK, works on sane cases. Now check whether non-existent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2840,22 +2349,23 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
+ (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
@@ -2866,7 +2376,6 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_preproc_ok=:
break
fi
-
rm -f conftest.err conftest.$ac_ext
done
@@ -2889,176 +2398,30 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
-echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- # Extract the first word of "grep ggrep" to use in msg output
-if test -z "$GREP"; then
-set dummy grep ggrep; ac_prog_name=$2
-if test "${ac_cv_path_GREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_path_GREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in grep ggrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
- # Check for GNU ac_path_GREP and select it if it is found.
- # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
- ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- echo 'GREP' >> "conftest.nl"
- "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_GREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_GREP="$ac_path_GREP"
- ac_path_GREP_max=$ac_count
- fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-
- $ac_path_GREP_found && break 3
- done
-done
-
-done
-IFS=$as_save_IFS
-
-
-fi
-
-GREP="$ac_cv_path_GREP"
-if test -z "$GREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-else
- ac_cv_path_GREP=$GREP
-fi
-
-
-fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
-echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
-
-{ echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
-if test "${ac_cv_path_EGREP+set}" = set; then
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
- then ac_cv_path_EGREP="$GREP -E"
- else
- # Extract the first word of "egrep" to use in msg output
-if test -z "$EGREP"; then
-set dummy egrep; ac_prog_name=$2
-if test "${ac_cv_path_EGREP+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- ac_path_EGREP_found=false
-# Loop through the user's path and test for each of PROGNAME-LIST
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_prog in egrep; do
- for ac_exec_ext in '' $ac_executable_extensions; do
- ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
- # Check for GNU ac_path_EGREP and select it if it is found.
- # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
- ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
- ac_count=0
- echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
- while :
- do
- cat "conftest.in" "conftest.in" >"conftest.tmp"
- mv "conftest.tmp" "conftest.in"
- cp "conftest.in" "conftest.nl"
- echo 'EGREP' >> "conftest.nl"
- "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
- diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
- ac_count=`expr $ac_count + 1`
- if test $ac_count -gt ${ac_path_EGREP_max-0}; then
- # Best one so far, save it but keep looking for a better one
- ac_cv_path_EGREP="$ac_path_EGREP"
- ac_path_EGREP_max=$ac_count
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
fi
- # 10*(2^10) chars as input seems more than enough
- test $ac_count -gt 10 && break
- done
- rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
-esac
-
-
- $ac_path_EGREP_found && break 3
- done
-done
-
-done
-IFS=$as_save_IFS
-
-
-fi
-
-EGREP="$ac_cv_path_EGREP"
-if test -z "$EGREP"; then
- { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
-echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
- { (exit 1); exit 1; }; }
-fi
-
-else
- ac_cv_path_EGREP=$EGREP
-fi
-
-
- fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
-echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
if test $ac_cv_c_compiler_gnu = yes; then
- { echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
-echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6; }
+ echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
+echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
if test "${ac_cv_prog_gcc_traditional+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_pattern="Autoconf.*'x'"
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3078,6 +2441,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3094,43 +2458,37 @@ rm -f conftest*
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
-echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_prog_gcc_traditional" >&5
+echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6
if test $ac_cv_prog_gcc_traditional = yes; then
CC="$CC -traditional"
fi
fi
ac_aux_dir=
-for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
- if test -f "$ac_dir/install-sh"; then
+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
+ 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
+ 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:$LINENO: 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;}
+ { { echo "$as_me:$LINENO: 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
-
-# These three variables are undocumented and unsupported,
-# and are intended to be withdrawn in a future Autoconf release.
-# They can cause serious problems if a builder's source tree is in a directory
-# whose full name contains unusual characters.
-ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
-ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
-ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
-
+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.
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -3143,10 +2501,9 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# 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"
-# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
-{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: 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
@@ -3160,7 +2517,6 @@ do
case $as_dir/ in
./ | .// | /cC/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
- ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
@@ -3168,41 +2524,40 @@ case $as_dir/ in
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
- if test $ac_prog = install &&
- grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # AIX install. It has an incompatible calling convention.
- :
- elif test $ac_prog = install &&
- grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
- # program-specific install script used by HP pwplus--don't use.
- :
- else
- ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
- break 3
- fi
- fi
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
done
done
;;
esac
done
-IFS=$as_save_IFS
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. Don't cache a
- # value for INSTALL within a source directory, because that will
+ # 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 value is a relative name.
+ # removed, or if the path is relative.
INSTALL=$ac_install_sh
fi
fi
-{ echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6; }
+echo "$as_me:$LINENO: 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.
@@ -3213,9 +2568,10 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-{ echo "$as_me:$LINENO: checking for AIX" >&5
-echo $ECHO_N "checking for AIX... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking for AIX" >&5
+echo $ECHO_N "checking for AIX... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3228,25 +2584,26 @@ cat >>conftest.$ac_ext <<_ACEOF
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "yes" >/dev/null 2>&1; then
- { echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6; }
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
cat >>confdefs.h <<\_ACEOF
#define _ALL_SOURCE 1
_ACEOF
else
- { echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
rm -f conftest*
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: 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 $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3266,35 +2623,30 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_header_stdc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_header_stdc=no
+ac_cv_header_stdc=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext 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 $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3316,6 +2668,7 @@ 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 $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3340,21 +2693,21 @@ if test $ac_cv_header_stdc = yes; then
:
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ctype.h>
-#include <stdlib.h>
#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'))
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
@@ -3365,28 +2718,19 @@ main ()
int i;
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
}
_ACEOF
rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
@@ -3399,14 +2743,12 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_header_stdc=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
-
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+echo "$as_me:$LINENO: 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 <<\_ACEOF
@@ -3426,15 +2768,16 @@ fi
for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
- inttypes.h stdint.h unistd.h
+ inttypes.h stdint.h unistd.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+echo "$as_me:$LINENO: 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 $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3445,35 +2788,28 @@ $ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
eval "$as_ac_Header=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- eval "$as_ac_Header=no"
+eval "$as_ac_Header=no"
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+echo "$as_me:$LINENO: 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 <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
@@ -3485,18 +2821,19 @@ done
if test "${ac_cv_header_minix_config_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for minix/config.h" >&5
-echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; }
+ echo "$as_me:$LINENO: checking for minix/config.h" >&5
+echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6
if test "${ac_cv_header_minix_config_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
-echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking minix/config.h usability" >&5
-echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking minix/config.h usability" >&5
+echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3506,38 +2843,33 @@ $ac_includes_default
#include <minix/config.h>
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_header_compiler=no
+ac_header_compiler=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
-{ echo "$as_me:$LINENO: checking minix/config.h presence" >&5
-echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking minix/config.h presence" >&5
+echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3545,22 +2877,23 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <minix/config.h>
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
@@ -3568,45 +2901,52 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
-
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
{ echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
;;
- no:yes:* )
+ no:yes )
{ echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;}
-
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for minix/config.h" >&5
-echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking for minix/config.h" >&5
+echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6
if test "${ac_cv_header_minix_config_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_minix_config_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
-echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5
+echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6
fi
if test $ac_cv_header_minix_config_h = yes; then
@@ -3634,97 +2974,121 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking for library containing strerror" >&5
-echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking for library containing strerror" >&5
+echo $ECHO_N "checking for library containing strerror... $ECHO_C" >&6
if test "${ac_cv_search_strerror+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
+ac_cv_search_strerror=no
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* 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 strerror ();
int
main ()
{
-return strerror ();
+strerror ();
;
return 0;
}
_ACEOF
-for ac_lib in '' cposix; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_search_strerror=$ac_res
+ (exit $ac_status); }; }; then
+ ac_cv_search_strerror="none required"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_strerror" = no; then
+ for ac_lib in cposix; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext
- if test "${ac_cv_search_strerror+set}" = set; then
- break
-fi
-done
-if test "${ac_cv_search_strerror+set}" = set; then
- :
+/* 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 strerror ();
+int
+main ()
+{
+strerror ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_strerror="-l$ac_lib"
+break
else
- ac_cv_search_strerror=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ done
fi
-rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
-echo "${ECHO_T}$ac_cv_search_strerror" >&6; }
-ac_res=$ac_cv_search_strerror
-if test "$ac_res" != no; then
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_search_strerror" >&5
+echo "${ECHO_T}$ac_cv_search_strerror" >&6
+if test "$ac_cv_search_strerror" != no; then
+ test "$ac_cv_search_strerror" = "none required" || LIBS="$ac_cv_search_strerror $LIBS"
fi
-{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: 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 $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3744,35 +3108,30 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_cv_header_stdc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_header_stdc=no
+ac_cv_header_stdc=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext 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 $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3794,6 +3153,7 @@ 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 $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3818,21 +3178,21 @@ if test $ac_cv_header_stdc = yes; then
:
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ctype.h>
-#include <stdlib.h>
#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'))
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
#endif
@@ -3843,28 +3203,19 @@ main ()
int i;
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
- || toupper (i) != TOUPPER (i))
- return 2;
- return 0;
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
}
_ACEOF
rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
@@ -3877,14 +3228,12 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_header_stdc=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
-
fi
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+echo "$as_me:$LINENO: 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 <<\_ACEOF
@@ -3893,12 +3242,13 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
-echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6
if test "${ac_cv_header_sys_wait_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3907,7 +3257,7 @@ cat >>conftest.$ac_ext <<_ACEOF
#include <sys/types.h>
#include <sys/wait.h>
#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
#ifndef WIFEXITED
# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
@@ -3924,34 +3274,28 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_cv_header_sys_wait_h=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_header_sys_wait_h=no
+ac_cv_header_sys_wait_h=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6
if test $ac_cv_header_sys_wait_h = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -3968,12 +3312,13 @@ fi
ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
-echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
+echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -3992,35 +3337,28 @@ return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
eval "$as_ac_Header=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- eval "$as_ac_Header=no"
+eval "$as_ac_Header=no"
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+echo "$as_me:$LINENO: 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 <<_ACEOF
#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
@@ -4032,170 +3370,216 @@ fi
done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
- { echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
+ echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
if test "${ac_cv_search_opendir+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
+ac_cv_search_opendir=no
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char opendir ();
int
main ()
{
-return opendir ();
+opendir ();
;
return 0;
}
_ACEOF
-for ac_lib in '' dir; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_search_opendir=$ac_res
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="none required"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_opendir" = no; then
+ for ac_lib in dir; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext
- if test "${ac_cv_search_opendir+set}" = set; then
- break
-fi
-done
-if test "${ac_cv_search_opendir+set}" = set; then
- :
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="-l$ac_lib"
+break
else
- ac_cv_search_opendir=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ done
fi
-rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
-ac_res=$ac_cv_search_opendir
-if test "$ac_res" != no; then
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6
+if test "$ac_cv_search_opendir" != no; then
+ test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
fi
else
- { echo "$as_me:$LINENO: checking for library containing opendir" >&5
-echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
+ echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
if test "${ac_cv_search_opendir+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_func_search_save_LIBS=$LIBS
+ac_cv_search_opendir=no
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char opendir ();
int
main ()
{
-return opendir ();
+opendir ();
;
return 0;
}
_ACEOF
-for ac_lib in '' x; do
- if test -z "$ac_lib"; then
- ac_res="none required"
- else
- ac_res=-l$ac_lib
- LIBS="-l$ac_lib $ac_func_search_save_LIBS"
- fi
- rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
- ac_cv_search_opendir=$ac_res
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="none required"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_opendir" = no; then
+ for ac_lib in x; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext
- if test "${ac_cv_search_opendir+set}" = set; then
- break
-fi
-done
-if test "${ac_cv_search_opendir+set}" = set; then
- :
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="-l$ac_lib"
+break
else
- ac_cv_search_opendir=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ done
fi
-rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
-echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
-ac_res=$ac_cv_search_opendir
-if test "$ac_res" != no; then
- test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6
+if test "$ac_cv_search_opendir" != no; then
+ test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
fi
@@ -4229,20 +3613,20 @@ for ac_header in \
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: 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
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -4252,38 +3636,33 @@ $ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_header_compiler=no
+ac_header_compiler=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -4291,22 +3670,23 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$ac_header>
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
@@ -4314,46 +3694,52 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
-
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
;;
- no:yes:* )
+ no:yes )
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+echo "$as_me:$LINENO: 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
- eval "$as_ac_Header=\$ac_header_preproc"
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -4367,18 +3753,19 @@ done
if test "${ac_cv_header_sys_cdefs_h+set}" = set; then
- { echo "$as_me:$LINENO: checking for sys/cdefs.h" >&5
-echo $ECHO_N "checking for sys/cdefs.h... $ECHO_C" >&6; }
+ echo "$as_me:$LINENO: checking for sys/cdefs.h" >&5
+echo $ECHO_N "checking for sys/cdefs.h... $ECHO_C" >&6
if test "${ac_cv_header_sys_cdefs_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_cdefs_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_cdefs_h" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_cdefs_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_cdefs_h" >&6
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking sys/cdefs.h usability" >&5
-echo $ECHO_N "checking sys/cdefs.h usability... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking sys/cdefs.h usability" >&5
+echo $ECHO_N "checking sys/cdefs.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -4388,38 +3775,33 @@ $ac_includes_default
#include <sys/cdefs.h>
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_header_compiler=no
+ac_header_compiler=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
-{ echo "$as_me:$LINENO: checking sys/cdefs.h presence" >&5
-echo $ECHO_N "checking sys/cdefs.h presence... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking sys/cdefs.h presence" >&5
+echo $ECHO_N "checking sys/cdefs.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -4427,22 +3809,23 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/cdefs.h>
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
@@ -4450,50 +3833,58 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
-
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
{ echo "$as_me:$LINENO: WARNING: sys/cdefs.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: sys/cdefs.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: sys/cdefs.h: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
+ { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/cdefs.h: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
;;
- no:yes:* )
+ no:yes )
{ echo "$as_me:$LINENO: WARNING: sys/cdefs.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: sys/cdefs.h: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: sys/cdefs.h: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: sys/cdefs.h: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: sys/cdefs.h: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/cdefs.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: sys/cdefs.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: sys/cdefs.h: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: sys/cdefs.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: sys/cdefs.h: in the future, the compiler will take precedence" >&2;}
-
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for sys/cdefs.h" >&5
-echo $ECHO_N "checking for sys/cdefs.h... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking for sys/cdefs.h" >&5
+echo $ECHO_N "checking for sys/cdefs.h... $ECHO_C" >&6
if test "${ac_cv_header_sys_cdefs_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_sys_cdefs_h=$ac_header_preproc
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_cdefs_h" >&5
-echo "${ECHO_T}$ac_cv_header_sys_cdefs_h" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_header_sys_cdefs_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_cdefs_h" >&6
fi
if test $ac_cv_header_sys_cdefs_h = yes; then
echo $ECHO_N "checking whether sys/cdefs.h is compatible... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -4520,19 +3911,26 @@ fi
-{ echo "$as_me:$LINENO: checking for __attribute__" >&5
-echo $ECHO_N "checking for __attribute__... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking for __attribute__" >&5
+echo $ECHO_N "checking for __attribute__... $ECHO_C" >&6
if test "${ac_cv___attribute__+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
+
#include <stdlib.h>
+
+int
+main ()
+{
+
static void foo(void) __attribute__ ((noreturn));
static void
@@ -4541,33 +3939,30 @@ foo(void)
exit(1);
}
+ ;
+ return 0;
+}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_cv___attribute__=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv___attribute__=no
+ac_cv___attribute__=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
if test "$ac_cv___attribute__" = "yes"; then
@@ -4577,16 +3972,17 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
fi
-{ echo "$as_me:$LINENO: result: $ac_cv___attribute__" >&5
-echo "${ECHO_T}$ac_cv___attribute__" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv___attribute__" >&5
+echo "${ECHO_T}$ac_cv___attribute__" >&6
-{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
-echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
if test "${ac_cv_c_bigendian+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
# See if sys/param.h defines the BYTE_ORDER macro.
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -4598,8 +3994,7 @@ cat >>conftest.$ac_ext <<_ACEOF
int
main ()
{
-#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \
- && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN)
+#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
bogus endian macros
#endif
@@ -4608,24 +4003,20 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
# It does; now see whether it defined to BIG_ENDIAN or not.
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -4646,50 +4037,45 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_cv_c_bigendian=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_c_bigendian=no
+ac_cv_c_bigendian=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- # It does not; compile a test program.
+# It does not; compile a test program.
if test "$cross_compiling" = yes; then
# try to guess the endianness by grepping values into an object file
ac_cv_c_bigendian=unknown
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
-short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
+short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
+short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; }
-short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
-short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
+short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
+short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; }
int
main ()
@@ -4700,22 +4086,17 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then
ac_cv_c_bigendian=yes
fi
@@ -4731,52 +4112,37 @@ else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_includes_default
int
main ()
{
-
/* Are we little or big endian? From Harbison&Steele. */
union
{
- long int l;
- char c[sizeof (long int)];
+ long l;
+ char c[sizeof (long)];
} u;
u.l = 1;
- return u.c[sizeof (long int) - 1] == 1;
-
- ;
- return 0;
+ exit (u.c[sizeof (long) - 1] == 1);
}
_ACEOF
rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
@@ -4789,16 +4155,13 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_c_bigendian=yes
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
-
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
-echo "${ECHO_T}$ac_cv_c_bigendian" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6
case $ac_cv_c_bigendian in
yes)
@@ -4816,12 +4179,13 @@ presetting ac_cv_c_bigendian=no (or yes) will help" >&2;}
{ (exit 1); exit 1; }; } ;;
esac
-{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: 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 $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -4835,10 +4199,10 @@ main ()
#ifndef __cplusplus
/* Ultrix mips cc rejects this. */
typedef int charset[2];
- const charset cs;
+ const charset x;
/* SunOS 4.1.1 cc rejects this. */
- char const *const *pcpcc;
- char **ppc;
+ 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};
@@ -4847,17 +4211,16 @@ main ()
an arm of an if-expression whose if-part is not a constant
expression */
const char *g = "string";
- pcpcc = &g + (g ? g-g : 0);
+ ccp = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
- ++pcpcc;
- ppc = (char**) pcpcc;
- pcpcc = (char const *const *) ppc;
+ ++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;
- if (s) return 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
int x[] = {25, 17};
@@ -4876,9 +4239,7 @@ main ()
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
- if (!foo) return 0;
}
- return !cs[0] && !zero.x;
#endif
;
@@ -4886,34 +4247,28 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_cv_c_const=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_c_const=no
+ac_cv_c_const=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6; }
+echo "$as_me:$LINENO: 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 <<\_ACEOF
@@ -4922,122 +4277,110 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking for off_t" >&5
-echo $ECHO_N "checking for off_t... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking for off_t" >&5
+echo $ECHO_N "checking for off_t... $ECHO_C" >&6
if test "${ac_cv_type_off_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-typedef off_t ac__type_new_;
int
main ()
{
-if ((ac__type_new_ *) 0)
+if ((off_t *) 0)
return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (off_t))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_cv_type_off_t=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_off_t=no
+ac_cv_type_off_t=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
-echo "${ECHO_T}$ac_cv_type_off_t" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_off_t" >&6
if test $ac_cv_type_off_t = yes; then
:
else
cat >>confdefs.h <<_ACEOF
-#define off_t long int
+#define off_t long
_ACEOF
fi
-{ echo "$as_me:$LINENO: checking for pid_t" >&5
-echo $ECHO_N "checking for pid_t... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking for pid_t" >&5
+echo $ECHO_N "checking for pid_t... $ECHO_C" >&6
if test "${ac_cv_type_pid_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-typedef pid_t ac__type_new_;
int
main ()
{
-if ((ac__type_new_ *) 0)
+if ((pid_t *) 0)
return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (pid_t))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_type_pid_t=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_pid_t=no
+ac_cv_type_pid_t=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
-echo "${ECHO_T}$ac_cv_type_pid_t" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_type_pid_t" >&5
+echo "${ECHO_T}$ac_cv_type_pid_t" >&6
if test $ac_cv_type_pid_t = yes; then
:
else
@@ -5048,92 +4391,81 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6
if test "${ac_cv_type_size_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
-typedef size_t ac__type_new_;
int
main ()
{
-if ((ac__type_new_ *) 0)
+if ((size_t *) 0)
return 0;
-if (sizeof (ac__type_new_))
+if (sizeof (size_t))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_cv_type_size_t=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_size_t=no
+ac_cv_type_size_t=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6
if test $ac_cv_type_size_t = yes; then
:
else
cat >>confdefs.h <<_ACEOF
-#define size_t unsigned int
+#define size_t unsigned
_ACEOF
fi
-{ echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5
-echo $ECHO_N "checking whether sys_siglist is declared... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking whether sys_siglist is declared" >&5
+echo $ECHO_N "checking whether sys_siglist is declared... $ECHO_C" >&6
if test "${ac_cv_have_decl_sys_siglist+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <signal.h>
-/* NetBSD declares sys_siglist in unistd.h. */
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
-
-
+$ac_includes_default
int
main ()
{
#ifndef sys_siglist
- (void) sys_siglist;
+ char *p = (char *) sys_siglist;
#endif
;
@@ -5141,34 +4473,28 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_have_decl_sys_siglist=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_have_decl_sys_siglist=no
+ac_cv_have_decl_sys_siglist=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5
-echo "${ECHO_T}$ac_cv_have_decl_sys_siglist" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_have_decl_sys_siglist" >&5
+echo "${ECHO_T}$ac_cv_have_decl_sys_siglist" >&6
if test $ac_cv_have_decl_sys_siglist = yes; then
cat >>confdefs.h <<_ACEOF
@@ -5186,12 +4512,13 @@ fi
-{ echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
-echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5
+echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6
if test "${ac_cv_header_time+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -5211,34 +4538,28 @@ return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_cv_header_time=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_header_time=no
+ac_cv_header_time=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
-echo "${ECHO_T}$ac_cv_header_time" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6
if test $ac_cv_header_time = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -5247,12 +4568,13 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
-echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
+echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6
if test "${ac_cv_struct_tm+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -5264,42 +4586,34 @@ cat >>conftest.$ac_ext <<_ACEOF
int
main ()
{
-struct tm tm;
- int *p = &tm.tm_sec;
- return !p;
+struct tm *tp; tp->tm_sec;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_cv_struct_tm=time.h
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_struct_tm=sys/time.h
+ac_cv_struct_tm=sys/time.h
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
-echo "${ECHO_T}$ac_cv_struct_tm" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
+echo "${ECHO_T}$ac_cv_struct_tm" >&6
if test $ac_cv_struct_tm = sys/time.h; then
cat >>confdefs.h <<\_ACEOF
@@ -5309,12 +4623,13 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5
-echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
if test "${ac_cv_type_signal+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -5322,44 +4637,46 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <signal.h>
+#ifdef signal
+# undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
+#endif
int
main ()
{
-return *(signal (0, 0)) (0) == 1;
+int i;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_type_signal=int
+ (exit $ac_status); }; }; then
+ ac_cv_type_signal=void
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_type_signal=void
+ac_cv_type_signal=int
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
-echo "${ECHO_T}$ac_cv_type_signal" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6
cat >>confdefs.h <<_ACEOF
#define RETSIGTYPE $ac_cv_type_signal
@@ -5367,23 +4684,24 @@ _ACEOF
-for ac_header in vfork.h
+
+for ac_header in unistd.h vfork.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
- { echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: 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
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
# Is the header compilable?
-{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -5393,38 +4711,33 @@ $ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_header_compiler=no
+ac_header_compiler=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6; }
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
-{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -5432,22 +4745,23 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$ac_header>
_ACEOF
-if { (ac_try="$ac_cpp conftest.$ac_ext"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null && {
- test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
- test ! -s conftest.err
- }; then
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
@@ -5455,46 +4769,52 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
-
rm -f conftest.err conftest.$ac_ext
-{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6; }
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
{ echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
;;
- no:yes:* )
+ no:yes )
{ echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
-
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
;;
esac
-{ echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
-if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+echo "$as_me:$LINENO: 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
- eval "$as_ac_Header=\$ac_header_preproc"
+ eval "$as_ac_Header=$ac_header_preproc"
fi
-ac_res=`eval echo '${'$as_ac_Header'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -5511,88 +4831,78 @@ done
for ac_func in fork vfork
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
-
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
+{
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
int
main ()
{
-return $ac_func ();
+return f != $ac_func;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- eval "$as_ac_var=no"
+eval "$as_ac_var=no"
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -5602,8 +4912,8 @@ fi
done
if test "x$ac_cv_func_fork" = xyes; then
- { echo "$as_me:$LINENO: checking for working fork" >&5
-echo $ECHO_N "checking for working fork... $ECHO_C" >&6; }
+ echo "$as_me:$LINENO: checking for working fork" >&5
+echo $ECHO_N "checking for working fork... $ECHO_C" >&6
if test "${ac_cv_func_fork_works+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5611,40 +4921,27 @@ else
ac_cv_func_fork_works=cross
else
cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_includes_default
-int
-main ()
-{
-
- /* By Ruediger Kuhlmann. */
- return fork () < 0;
-
- ;
- return 0;
-}
+/* By Ruediger Kuhlmann. */
+ #include <sys/types.h>
+ #if HAVE_UNISTD_H
+ # include <unistd.h>
+ #endif
+ /* Some systems only have a dummy stub for fork() */
+ int main ()
+ {
+ if (fork() < 0)
+ exit (1);
+ exit (0);
+ }
_ACEOF
rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
@@ -5657,13 +4954,11 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_func_fork_works=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
-
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
-echo "${ECHO_T}$ac_cv_func_fork_works" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_func_fork_works" >&5
+echo "${ECHO_T}$ac_cv_func_fork_works" >&6
else
ac_cv_func_fork_works=$ac_cv_func_fork
@@ -5683,8 +4978,8 @@ echo "$as_me: WARNING: result $ac_cv_func_fork_works guessed because of cross co
fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
if test "x$ac_cv_func_vfork" = xyes; then
- { echo "$as_me:$LINENO: checking for working vfork" >&5
-echo $ECHO_N "checking for working vfork... $ECHO_C" >&6; }
+ echo "$as_me:$LINENO: checking for working vfork" >&5
+echo $ECHO_N "checking for working vfork... $ECHO_C" >&6
if test "${ac_cv_func_vfork_works+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5692,15 +4987,22 @@ else
ac_cv_func_vfork_works=cross
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Thanks to Paul Eggert for this test. */
-$ac_includes_default
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <sys/wait.h>
-#ifdef HAVE_VFORK_H
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+#if HAVE_VFORK_H
# include <vfork.h>
#endif
/* On some sparc systems, changes by the child to local and incoming
@@ -5771,7 +5073,7 @@ main ()
while (wait(&status) != child)
;
- return (
+ exit(
/* Was there some problem with vforking? */
child < 0
@@ -5788,22 +5090,13 @@ main ()
}
_ACEOF
rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
@@ -5816,17 +5109,15 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_func_vfork_works=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
-
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
-echo "${ECHO_T}$ac_cv_func_vfork_works" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_func_vfork_works" >&5
+echo "${ECHO_T}$ac_cv_func_vfork_works" >&6
fi;
if test "x$ac_cv_func_fork_works" = xcross; then
- ac_cv_func_vfork_works=$ac_cv_func_vfork
+ ac_cv_func_vfork_works=ac_cv_func_vfork
{ echo "$as_me:$LINENO: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&5
echo "$as_me: WARNING: result $ac_cv_func_vfork_works guessed because of cross compilation" >&2;}
fi
@@ -5856,174 +5147,155 @@ fi
for ac_func in vprintf
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
-
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
+{
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
int
main ()
{
-return $ac_func ();
+return f != $ac_func;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- eval "$as_ac_var=no"
+eval "$as_ac_var=no"
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
-{ echo "$as_me:$LINENO: checking for _doprnt" >&5
-echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking for _doprnt" >&5
+echo $ECHO_N "checking for _doprnt... $ECHO_C" >&6
if test "${ac_cv_func__doprnt+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Define _doprnt to an innocuous variant, in case <limits.h> declares _doprnt.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define _doprnt innocuous__doprnt
-
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char _doprnt (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
-
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
-
-#undef _doprnt
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* 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 _doprnt ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined __stub__doprnt || defined __stub____doprnt
+#if defined (__stub__doprnt) || defined (__stub____doprnt)
choke me
+#else
+char (*f) () = _doprnt;
+#endif
+#ifdef __cplusplus
+}
#endif
int
main ()
{
-return _doprnt ();
+return f != _doprnt;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ (exit $ac_status); }; }; then
ac_cv_func__doprnt=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_func__doprnt=no
+ac_cv_func__doprnt=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
-echo "${ECHO_T}$ac_cv_func__doprnt" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_func__doprnt" >&5
+echo "${ECHO_T}$ac_cv_func__doprnt" >&6
if test $ac_cv_func__doprnt = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -6036,8 +5308,8 @@ fi
done
-{ echo "$as_me:$LINENO: checking for wait3 that fills in rusage" >&5
-echo $ECHO_N "checking for wait3 that fills in rusage... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking for wait3 that fills in rusage" >&5
+echo $ECHO_N "checking for wait3 that fills in rusage... $ECHO_C" >&6
if test "${ac_cv_func_wait3_rusage+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -6045,15 +5317,16 @@ else
ac_cv_func_wait3_rusage=no
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_includes_default
+#include <sys/types.h>
#include <sys/time.h>
#include <sys/resource.h>
-#include <sys/wait.h>
+#include <stdio.h>
/* HP-UX has wait3 but does not fill in rusage at all. */
int
main ()
@@ -6081,28 +5354,19 @@ main ()
wait3(&i, 0, &r);
/* Avoid "text file busy" from rm on fast HP-UX machines. */
sleep(2);
- return (r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
- && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
+ exit (r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0
+ && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0);
}
}
_ACEOF
rm -f conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>&5
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_try") 2>&5
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
@@ -6115,13 +5379,11 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_func_wait3_rusage=no
fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
-
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_func_wait3_rusage" >&5
-echo "${ECHO_T}$ac_cv_func_wait3_rusage" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_func_wait3_rusage" >&5
+echo "${ECHO_T}$ac_cv_func_wait3_rusage" >&6
if test $ac_cv_func_wait3_rusage = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -6152,8 +5414,13 @@ fi
+
+
+
+
for ac_func in \
asprintf \
+ emalloc \
getcwd \
getenv \
getopt \
@@ -6166,10 +5433,13 @@ for ac_func in \
sigvec \
snprintf \
strdup \
+ estrndup \
+ strndup \
strerror \
strftime \
strtod \
strtol \
+ unsetenv \
vasprintf \
vsnprintf \
wait3 \
@@ -6178,88 +5448,78 @@ for ac_func in \
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
-
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
+{
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
int
main ()
{
-return $ac_func ();
+return f != $ac_func;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ (exit $ac_status); }; }; then
eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- eval "$as_ac_var=no"
+eval "$as_ac_var=no"
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -6272,110 +5532,96 @@ done
for ac_func in getenv
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-{ echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
-if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
- For example, HP-UX 11i <limits.h> declares gettimeofday. */
-#define $ac_func innocuous_$ac_func
-
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func (); below.
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
<limits.h> exists even on freestanding compilers. */
-
#ifdef __STDC__
# include <limits.h>
#else
# include <assert.h>
#endif
-
-#undef $ac_func
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
+{
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined __stub_$ac_func || defined __stub___$ac_func
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
+#else
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
int
main ()
{
-return $ac_func ();
+return f != $ac_func;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_link") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext &&
- $as_test_x conftest$ac_exeext; then
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- eval "$as_ac_var=no"
+eval "$as_ac_var=no"
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
- conftest$ac_exeext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-ac_res=`eval echo '${'$as_ac_var'}'`
- { echo "$as_me:$LINENO: result: $ac_res" >&5
-echo "${ECHO_T}$ac_res" >&6; }
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
else
- case " $LIBOBJS " in
- *" $ac_func.$ac_objext "* ) ;;
- *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
- ;;
-esac
-
+ LIBOBJS="$LIBOBJS $ac_func.$ac_objext"
fi
done
-{ echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5
-echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6; }
+echo "$as_me:$LINENO: checking whether stat file-mode macros are broken" >&5
+echo $ECHO_N "checking whether stat file-mode macros are broken... $ECHO_C" >&6
if test "${ac_cv_header_stat_broken+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -6384,52 +5630,42 @@ cat >>conftest.$ac_ext <<_ACEOF
#include <sys/types.h>
#include <sys/stat.h>
-#if defined S_ISBLK && defined S_IFDIR
-extern char c1[S_ISBLK (S_IFDIR) ? -1 : 1];
+#if defined(S_ISBLK) && defined(S_IFDIR)
+# if S_ISBLK (S_IFDIR)
+You lose.
+# endif
#endif
-#if defined S_ISBLK && defined S_IFCHR
-extern char c2[S_ISBLK (S_IFCHR) ? -1 : 1];
+#if defined(S_ISBLK) && defined(S_IFCHR)
+# if S_ISBLK (S_IFCHR)
+You lose.
+# endif
#endif
-#if defined S_ISLNK && defined S_IFREG
-extern char c3[S_ISLNK (S_IFREG) ? -1 : 1];
+#if defined(S_ISLNK) && defined(S_IFREG)
+# if S_ISLNK (S_IFREG)
+You lose.
+# endif
#endif
-#if defined S_ISSOCK && defined S_IFREG
-extern char c4[S_ISSOCK (S_IFREG) ? -1 : 1];
+#if defined(S_ISSOCK) && defined(S_IFREG)
+# if S_ISSOCK (S_IFREG)
+You lose.
+# endif
#endif
_ACEOF
-rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
- ac_cv_header_stat_broken=no
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "You lose" >/dev/null 2>&1; then
+ ac_cv_header_stat_broken=yes
else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_cv_header_stat_broken=yes
+ ac_cv_header_stat_broken=no
fi
+rm -f conftest*
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5
-echo "${ECHO_T}$ac_cv_header_stat_broken" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_header_stat_broken" >&5
+echo "${ECHO_T}$ac_cv_header_stat_broken" >&6
if test $ac_cv_header_stat_broken = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -6438,12 +5674,14 @@ _ACEOF
fi
-{ echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5
-echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6; }
+
+echo "$as_me:$LINENO: checking for struct stat.st_rdev" >&5
+echo $ECHO_N "checking for struct stat.st_rdev... $ECHO_C" >&6
if test "${ac_cv_member_struct_stat_st_rdev+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -6461,28 +5699,24 @@ return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_cv_member_struct_stat_st_rdev=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- cat >conftest.$ac_ext <<_ACEOF
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -6500,37 +5734,30 @@ return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
- (eval "$ac_compile") 2>conftest.er1
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then
+ (exit $ac_status); }; }; then
ac_cv_member_struct_stat_st_rdev=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_cv_member_struct_stat_st_rdev=no
+ac_cv_member_struct_stat_st_rdev=no
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-{ echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5
-echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6; }
+echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_rdev" >&5
+echo "${ECHO_T}$ac_cv_member_struct_stat_st_rdev" >&6
if test $ac_cv_member_struct_stat_st_rdev = yes; then
cat >>confdefs.h <<_ACEOF
@@ -6580,9 +5807,10 @@ machine=${machine:-`$srcdir/machine.sh`}
machine_arch=${machine_arch:-`$srcdir/machine.sh arch`}
echo "defaults: MACHINE=$machine, MACHINE_ARCH=$machine_arch" 1>&6
-# Check whether --with-machine was given.
+# Check whether --with-machine or --without-machine was given.
if test "${with_machine+set}" = set; then
- withval=$with_machine; case "${withval}" in
+ withval="$with_machine"
+ case "${withval}" in
yes) { { echo "$as_me:$LINENO: error: bad value ${withval} given for bmake MACHINE" >&5
echo "$as_me: error: bad value ${withval} given for bmake MACHINE" >&2;}
{ (exit 1); exit 1; }; } ;;
@@ -6590,97 +5818,95 @@ no) ;;
generic) machine=`$srcdir/machine.sh`;;
*) machine=$with_machine;;
esac
-fi
-
+fi;
force_machine=
-# Check whether --with-force_machine was given.
+# Check whether --with-force_machine or --without-force_machine was given.
if test "${with_force_machine+set}" = set; then
- withval=$with_force_machine; case "${withval}" in
+ withval="$with_force_machine"
+ case "${withval}" in
yes) force_machine=FORCE_;;
no) ;;
*) force_machine=FORCE_; machine=$with_force_machine;;
esac
-fi
-
+fi;
force_machine_arch=
-# Check whether --with-force_machine_arch was given.
+# Check whether --with-force_machine_arch or --without-force_machine_arch was given.
if test "${with_force_machine_arch+set}" = set; then
- withval=$with_force_machine_arch; case "${withval}" in
+ withval="$with_force_machine_arch"
+ case "${withval}" in
yes) force_machine_arch=FORCE_;;
no) ;;
*) force_machine_arch=FORCE_; machine_arch=$with_force_machine;;
esac
-fi
-
+fi;
-# Check whether --with-machine_arch was given.
+# Check whether --with-machine_arch or --without-machine_arch was given.
if test "${with_machine_arch+set}" = set; then
- withval=$with_machine_arch; case "${withval}" in
+ withval="$with_machine_arch"
+ case "${withval}" in
yes) { { echo "$as_me:$LINENO: error: bad value ${withval} given for bmake MACHINE_ARCH" >&5
echo "$as_me: error: bad value ${withval} given for bmake MACHINE_ARCH" >&2;}
{ (exit 1); exit 1; }; } ;;
no) ;;
*) machine_arch=$with_machine_arch;;
esac
-fi
-
+fi;
echo "Using: ${force_machine}MACHINE=$machine, MACHINE_ARCH=$machine_arch" 1>&6
-DEFAULT_SYS_PATH=\${prefix}/share/mk
+default_sys_path=\${prefix}/share/mk
-# Check whether --with-default-sys-path was given.
+# Check whether --with-default-sys-path or --without-default-sys-path was given.
if test "${with_default_sys_path+set}" = set; then
- withval=$with_default_sys_path; case "${withval}" in
-yes) { { echo "$as_me:$LINENO: error: bad value ${withval} given for bmake DEFAULT_SYS_PATH" >&5
-echo "$as_me: error: bad value ${withval} given for bmake DEFAULT_SYS_PATH" >&2;}
+ withval="$with_default_sys_path"
+ case "${withval}" in
+yes) { { echo "$as_me:$LINENO: error: bad value ${withval} given for bmake _PATH_DEFSYSPATH" >&5
+echo "$as_me: error: bad value ${withval} given for bmake _PATH_DEFSYSPATH" >&2;}
{ (exit 1); exit 1; }; } ;;
no) ;;
-*) DEFAULT_SYS_PATH="$with_default_sys_path"
+*) default_sys_path="$with_default_sys_path"
;;
esac
-fi
-
-
-
+fi;
-# Check whether --with-path-objdirprefix was given.
+# Check whether --with-path-objdirprefix or --without-path-objdirprefix was given.
if test "${with_path_objdirprefix+set}" = set; then
- withval=$with_path_objdirprefix; case "${withval}" in
+ withval="$with_path_objdirprefix"
+ case "${withval}" in
yes) { { echo "$as_me:$LINENO: error: bad value ${withval} given for bmake _PATH_OBJDIRPREFIX" >&5
echo "$as_me: error: bad value ${withval} given for bmake _PATH_OBJDIRPREFIX" >&2;}
{ (exit 1); exit 1; }; } ;;
no) CPPFLAGS="$CPPFLAGS -DNO_PATH_OBJDIRPREFIX" ;;
*) CPPFLAGS="$CPPFLAGS \"-D_PATH_OBJDIRPREFIX=\\\"$with_path-objdir\\\"\"" ;;
esac
-fi
-
-# Check whether --enable-pwd-override was given.
+fi;
+# Check whether --enable-pwd-override or --disable-pwd-override was given.
if test "${enable_pwd_override+set}" = set; then
- enableval=$enable_pwd_override; case "${enableval}" in
+ enableval="$enable_pwd_override"
+ case "${enableval}" in
yes) ;;
no) CPPFLAGS="$CPPFLAGS -DNO_PWD_OVERRIDE" ;;
*) { { echo "$as_me:$LINENO: error: bad value ${enableval} given for pwd-override option" >&5
echo "$as_me: error: bad value ${enableval} given for pwd-override option" >&2;}
{ (exit 1); exit 1; }; } ;;
esac
-fi
-
-# Check whether --enable-check-make-chdir was given.
+fi;
+# Check whether --enable-check-make-chdir or --disable-check-make-chdir was given.
if test "${enable_check_make_chdir+set}" = set; then
- enableval=$enable_check_make_chdir; case "${enableval}" in
+ enableval="$enable_check_make_chdir"
+ case "${enableval}" in
yes) ;;
no) CPPFLAGS="$CPPFLAGS -DNO_CHECK_MAKE_CHDIR" ;;
*) { { echo "$as_me:$LINENO: error: bad value ${enableval} given for check-make-chdir option" >&5
echo "$as_me: error: bad value ${enableval} given for check-make-chdir option" >&2;}
{ (exit 1); exit 1; }; } ;;
esac
-fi
-
+fi;
-# Check whether --with-mksrc was given.
+# Check whether --with-mksrc or --without-mksrc was given.
if test "${with_mksrc+set}" = set; then
- withval=$with_mksrc; case "${withval}" in
+ withval="$with_mksrc"
+ case "${withval}" in
""|yes|no) ;;
*) test -s $withval/install-mk && mksrc=$withval ||
{ { echo "$as_me:$LINENO: error: bad value ${withval} given for mksrc cannot find install-mk" >&5
@@ -6689,14 +5915,31 @@ echo "$as_me: error: bad value ${withval} given for mksrc cannot find install-mk
;;
esac
-fi
-
+fi;
for mksrc in $mksrc $srcdir/mk $srcdir/../mk mk
do
test -s $mksrc/install-mk && break
done
mksrc=`echo $mksrc | sed "s,$srcdir,\\\${srcdir},"`
echo "Using: MKSRC=$mksrc" 1>&6
+if test -x /usr/xpg4/bin/sh; then
+ defshell_path=${defshell_path:-/usr/xpg4/bin/sh}
+fi
+if test -n "$defshell_path"; then
+ echo "Using: SHELL=$defshell_path" >&6
+
+cat >>confdefs.h <<_ACEOF
+#define DEFSHELL_CUSTOM "$defshell_path"
+_ACEOF
+
+fi
+if test -n "$DEFSHELL_INDEX"; then
+
+cat >>confdefs.h <<_ACEOF
+#define DEFSHELL_INDEX $DEFSHELL_INDEX
+_ACEOF
+
+fi
@@ -6704,8 +5947,8 @@ echo "Using: MKSRC=$mksrc" 1>&6
-ac_config_files="$ac_config_files Makefile makefile.boot lst.lib/makefile.boot unit-tests/Makefile"
+ ac_config_files="$ac_config_files Makefile makefile.boot lst.lib/makefile.boot unit-tests/Makefile"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -6724,58 +5967,39 @@ _ACEOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
-# So, we kill variables containing newlines.
+# So, don't put newlines in cache variables' values.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
-(
- for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
- eval ac_val=\$$ac_var
- case $ac_val in #(
- *${as_nl}*)
- case $ac_var in #(
- *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
-echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
- esac
- case $ac_var in #(
- _ | IFS | as_nl) ;; #(
- *) $as_unset $ac_var ;;
- esac ;;
- esac
- done
-
+{
(set) 2>&1 |
- case $as_nl`(ac_space=' '; set) 2>&1` in #(
- *${as_nl}ac_space=\ *)
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
- "s/'/'\\\\''/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;; #(
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
;;
- esac |
- sort
-) |
+ esac;
+} |
sed '
- /^ac_cv_env_/b end
t clear
- :clear
+ : clear
s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
t end
- s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- :end' >>confcache
-if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
- if test -w "$cache_file"; then
- test "x$cache_file" != "x/dev/null" &&
- { echo "$as_me:$LINENO: updating cache $cache_file" >&5
-echo "$as_me: updating cache $cache_file" >&6;}
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
+ if test -w $cache_file; then
+ test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
cat confcache >$cache_file
else
- { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
-echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+ echo "not updating unwritable cache $cache_file"
fi
fi
rm -f confcache
@@ -6784,18 +6008,32 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
+fi
+
DEFS=-DHAVE_CONFIG_H
ac_libobjs=
ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
- ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
- ac_i=`echo "$ac_i" | sed "$ac_script"`
- # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
- # will be set to the directory where LIBOBJS objects are built.
- ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
@@ -6826,91 +6064,27 @@ cat >>$CONFIG_STATUS <<\_ACEOF
## M4sh Initialization. ##
## --------------------- ##
-# Be more Bourne compatible
-DUALCASE=1; export DUALCASE # for MKS sh
+# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
- setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in
- *posix*) set -o posix ;;
-esac
-
-fi
-
-
-
-
-# PATH needs CR
-# 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
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
fi
# Support unset when possible.
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
as_unset=unset
else
as_unset=false
fi
-# IFS
-# We need space, tab and new line, in precisely that order. Quoting is
-# there to prevent editors from complaining about space-tab.
-# (If _AS_PATH_WALK were called with IFS unset, it would disable word
-# splitting by setting IFS to empty value.)
-as_nl='
-'
-IFS=" "" $as_nl"
-
-# Find who we are. Look in the path if we contain no directory separator.
-case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-IFS=$as_save_IFS
-
- ;;
-esac
-# We did not find ourselves, most probably we were run as `sh COMMAND'
-# in which case we are not to be found in the path.
-if test "x$as_myself" = x; then
- as_myself=$0
-fi
-if test ! -f "$as_myself"; then
- echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
- { (exit 1); exit 1; }
-fi
-
# Work around bugs in pre-3.0 UWIN ksh.
-for as_var in ENV MAIL MAILPATH
-do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
-done
+$as_unset ENV MAIL MAILPATH
PS1='$ '
PS2='> '
PS4='+ '
@@ -6921,22 +6095,21 @@ for as_var in \
LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
LC_TELEPHONE LC_TIME
do
- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
- ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ $as_unset $as_var
fi
done
# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
+if expr a : '\(a\)' >/dev/null 2>&1; then
as_expr=expr
else
as_expr=false
fi
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
@@ -6944,166 +6117,200 @@ fi
# Name of the executable.
-as_me=`$as_basename -- "$0" ||
+as_me=`$as_basename "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
-# CDPATH.
-$as_unset CDPATH
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# 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
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
as_lineno_1=$LINENO
as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
# Create $as_me.lineno as a copy of $as_myself, but with $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line after each line using $LINENO; the second 'sed'
- # does the real work. The second script uses 'N' to pair each
- # line-number line with the line containing $LINENO, and appends
- # trailing '-' during substitution so that $LINENO is not a special
- # case at line end.
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # scripts with optimization help from Paolo Bonzini. Blame Lee
- # E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
t loop
- s/-\n.*//
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
# Exit status is that of the last command.
exit
}
-if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
- as_dirname=dirname
-else
- as_dirname=false
-fi
-
-ECHO_C= ECHO_N= ECHO_T=
-case `echo -n x` in
--n*)
- case `echo 'x\c'` in
- *c*) ECHO_T=' ';; # ECHO_T is single tab character.
- *) ECHO_C='\c';;
- esac;;
-*)
- ECHO_N='-n';;
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
esac
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
+if expr a : '\(a\)' >/dev/null 2>&1; then
as_expr=expr
else
as_expr=false
fi
rm -f conf$$ conf$$.exe conf$$.file
-if test -d conf$$.dir; then
- rm -f conf$$.dir/conf$$.file
-else
- rm -f conf$$.dir
- mkdir conf$$.dir
-fi
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
- as_ln_s='ln -s'
- # ... but there are two gotchas:
- # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
- # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
- ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+ # 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$$.dir/conf$$.file conf$$.file
-rmdir conf$$.dir 2>/dev/null
+rm -f conf$$ conf$$.exe conf$$.file
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
else
- test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+as_executable_p="test -f"
# Sed expression to map a string onto a valid CPP name.
-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
# Sed expression to map a string onto a valid variable name.
-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+# CDPATH.
+$as_unset CDPATH
exec 6>&1
-# Save the log message, to keep $[0] and so on meaningful, and to
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling.
-ac_log="
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.61. Invocation command line was
+generated by GNU Autoconf 2.57. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -7111,19 +6318,30 @@ generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
-on `(hostname || uname -n) 2>/dev/null | sed 1q`
-"
-
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
# Files that config.status was made for.
-config_files="$ac_config_files"
-config_headers="$ac_config_headers"
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
-_ACEOF
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
cat >>$CONFIG_STATUS <<\_ACEOF
+
ac_cs_usage="\
\`$as_me' instantiates files from templates according to the
current configuration.
@@ -7131,14 +6349,14 @@ current configuration.
Usage: $0 [OPTIONS] [FILE]...
-h, --help print this help, then exit
- -V, --version print version number and configuration settings, then exit
+ -V, --version print version number, then exit
-q, --quiet do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
- instantiate the configuration file FILE
+ instantiate the configuration file FILE
--header=FILE[:TEMPLATE]
- instantiate the configuration header FILE
+ instantiate the configuration header FILE
Configuration files:
$config_files
@@ -7147,21 +6365,20 @@ Configuration headers:
$config_headers
Report bugs to <bug-autoconf@gnu.org>."
-
_ACEOF
+
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.61,
- with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.57,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
-Copyright (C) 2006 Free Software Foundation, Inc.
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
-
-ac_pwd='$ac_pwd'
-srcdir='$srcdir'
-INSTALL='$INSTALL'
+srcdir=$srcdir
+INSTALL="$INSTALL"
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
@@ -7172,24 +6389,39 @@ while test $# != 0
do
case $1 in
--*=*)
- ac_option=`expr "X$1" : 'X\([^=]*\)='`
- ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
ac_shift=:
;;
- *)
+ -*)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
esac
case $ac_option in
# Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
- --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
- echo "$ac_cs_version"; exit ;;
- --debug | --debu | --deb | --de | --d | -d )
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
@@ -7199,24 +6431,18 @@ do
$ac_shift
CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
ac_need_defaults=false;;
- --he | --h)
- # Conflict between --help and --header
- { echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
- -*) { echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
{ (exit 1); exit 1; }; } ;;
- *) ac_config_targets="$ac_config_targets $1"
- ac_need_defaults=false ;;
+ *) ac_config_targets="$ac_config_targets $1" ;;
esac
shift
@@ -7232,46 +6458,32 @@ fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
if \$ac_cs_recheck; then
- echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- CONFIG_SHELL=$SHELL
- export CONFIG_SHELL
- exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
fi
_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
- echo "$ac_log"
-} >&5
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-# Handling of arguments.
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
for ac_config_target in $ac_config_targets
do
- case $ac_config_target in
- "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
- "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "makefile.boot") CONFIG_FILES="$CONFIG_FILES makefile.boot" ;;
- "lst.lib/makefile.boot") CONFIG_FILES="$CONFIG_FILES lst.lib/makefile.boot" ;;
- "unit-tests/Makefile") CONFIG_FILES="$CONFIG_FILES unit-tests/Makefile" ;;
-
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "makefile.boot" ) CONFIG_FILES="$CONFIG_FILES makefile.boot" ;;
+ "lst.lib/makefile.boot" ) CONFIG_FILES="$CONFIG_FILES lst.lib/makefile.boot" ;;
+ "unit-tests/Makefile" ) CONFIG_FILES="$CONFIG_FILES unit-tests/Makefile" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
done
-
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
@@ -7282,378 +6494,274 @@ if $ac_need_defaults; then
fi
# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason against having it here, and in addition,
+# simply because there is no reason to put it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
-# Hook for its removal unless debugging.
-# Note that there is a small window in which the directory will not be cleaned:
-# after its creation but before its name has been assigned to `$tmp'.
+# Create a temporary directory, and hook for its removal unless debugging.
$debug ||
{
- tmp=
- trap 'exit_status=$?
- { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
-' 0
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
trap '{ (exit 1); exit 1; }' 1 2 13 15
}
+
# Create a (secure) tmp directory for tmp files.
{
- tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
test -n "$tmp" && test -d "$tmp"
} ||
{
- tmp=./conf$$-$RANDOM
- (umask 077 && mkdir "$tmp")
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
} ||
{
echo "$me: cannot create a temporary directory in ." >&2
{ (exit 1); exit 1; }
}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
#
-# Set up the sed scripts for CONFIG_FILES section.
+# CONFIG_FILES section.
#
# No need to generate the scripts if there are no CONFIG_FILES.
# This happens for instance when ./config.status config.h
-if test -n "$CONFIG_FILES"; then
-
-_ACEOF
-
-
-
-ac_delim='%!_!# '
-for ac_last_try in false false false false false :; do
- cat >conf$$subs.sed <<_ACEOF
-SHELL!$SHELL$ac_delim
-PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
-PACKAGE_NAME!$PACKAGE_NAME$ac_delim
-PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
-PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
-PACKAGE_STRING!$PACKAGE_STRING$ac_delim
-PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
-exec_prefix!$exec_prefix$ac_delim
-prefix!$prefix$ac_delim
-program_transform_name!$program_transform_name$ac_delim
-bindir!$bindir$ac_delim
-sbindir!$sbindir$ac_delim
-libexecdir!$libexecdir$ac_delim
-datarootdir!$datarootdir$ac_delim
-datadir!$datadir$ac_delim
-sysconfdir!$sysconfdir$ac_delim
-sharedstatedir!$sharedstatedir$ac_delim
-localstatedir!$localstatedir$ac_delim
-includedir!$includedir$ac_delim
-oldincludedir!$oldincludedir$ac_delim
-docdir!$docdir$ac_delim
-infodir!$infodir$ac_delim
-htmldir!$htmldir$ac_delim
-dvidir!$dvidir$ac_delim
-pdfdir!$pdfdir$ac_delim
-psdir!$psdir$ac_delim
-libdir!$libdir$ac_delim
-localedir!$localedir$ac_delim
-mandir!$mandir$ac_delim
-DEFS!$DEFS$ac_delim
-ECHO_C!$ECHO_C$ac_delim
-ECHO_N!$ECHO_N$ac_delim
-ECHO_T!$ECHO_T$ac_delim
-LIBS!$LIBS$ac_delim
-build_alias!$build_alias$ac_delim
-host_alias!$host_alias$ac_delim
-target_alias!$target_alias$ac_delim
-DEFAULT_CSH!$DEFAULT_CSH$ac_delim
-DEFAULT_KSH!$DEFAULT_KSH$ac_delim
-DEFAULT_SH!$DEFAULT_SH$ac_delim
-CC!$CC$ac_delim
-CFLAGS!$CFLAGS$ac_delim
-LDFLAGS!$LDFLAGS$ac_delim
-CPPFLAGS!$CPPFLAGS$ac_delim
-ac_ct_CC!$ac_ct_CC$ac_delim
-EXEEXT!$EXEEXT$ac_delim
-OBJEXT!$OBJEXT$ac_delim
-CPP!$CPP$ac_delim
-GREP!$GREP$ac_delim
-EGREP!$EGREP$ac_delim
-INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
-INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
-INSTALL_DATA!$INSTALL_DATA$ac_delim
-ac_exe_suffix!$ac_exe_suffix$ac_delim
-LIBOBJS!$LIBOBJS$ac_delim
-DEFAULT_SYS_PATH!$DEFAULT_SYS_PATH$ac_delim
-machine!$machine$ac_delim
-force_machine!$force_machine$ac_delim
-machine_arch!$machine_arch$ac_delim
-mksrc!$mksrc$ac_delim
-INSTALL!$INSTALL$ac_delim
-GCC!$GCC$ac_delim
-diff_u!$diff_u$ac_delim
-LTLIBOBJS!$LTLIBOBJS$ac_delim
-_ACEOF
-
- if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 64; then
- break
- elif $ac_last_try; then
- { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
-echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
- { (exit 1); exit 1; }; }
- else
- ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@ac_exe_suffix@,$ac_exe_suffix,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@machine@,$machine,;t t
+s,@force_machine@,$force_machine,;t t
+s,@machine_arch@,$machine_arch,;t t
+s,@mksrc@,$mksrc,;t t
+s,@default_sys_path@,$default_sys_path,;t t
+s,@INSTALL@,$INSTALL,;t t
+s,@GCC@,$GCC,;t t
+s,@diff_u@,$diff_u,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # Split the substitutions into bite-sized pieces for seds with
+ # small command number limits, like on Digital OSF/1 and HP-UX.
+ ac_max_sed_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # Line after last line for current file.
+ ac_more_lines=:
+ ac_sed_cmds=
+ while $ac_more_lines; do
+ if test $ac_beg -gt 1; then
+ sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
fi
-done
-
-ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
-if test -n "$ac_eof"; then
- ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
- ac_eof=`expr $ac_eof + 1`
-fi
+fi # test -n "$CONFIG_FILES"
-cat >>$CONFIG_STATUS <<_ACEOF
-cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
-_ACEOF
-sed '
-s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
-s/^/s,@/; s/!/@,|#_!!_#|/
-:n
-t n
-s/'"$ac_delim"'$/,g/; t
-s/$/\\/; p
-N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
-' >>$CONFIG_STATUS <conf$$subs.sed
-rm -f conf$$subs.sed
-cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
-CEOF$ac_eof
_ACEOF
-
-
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/
-s/:*\${srcdir}:*/:/
-s/:*@srcdir@:*/:/
-s/^\([^=]*=[ ]*\):*/\1/
-s/:*$//
-s/^[^=]*=[ ]*$//
-}'
-fi
-
cat >>$CONFIG_STATUS <<\_ACEOF
-fi # test -n "$CONFIG_FILES"
-
-
-for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS
-do
- case $ac_tag in
- :[FHLC]) ac_mode=$ac_tag; continue;;
- esac
- case $ac_mode$ac_tag in
- :[FHL]*:*);;
- :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
-echo "$as_me: error: Invalid tag $ac_tag." >&2;}
- { (exit 1); exit 1; }; };;
- :[FH]-) ac_tag=-:-;;
- :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
- esac
- ac_save_IFS=$IFS
- IFS=:
- set x $ac_tag
- IFS=$ac_save_IFS
- shift
- ac_file=$1
- shift
-
- case $ac_mode in
- :L) ac_source=$1;;
- :[FH])
- ac_file_inputs=
- for ac_f
- do
- case $ac_f in
- -) ac_f="$tmp/stdin";;
- *) # Look for the file first in the build tree, then in the source tree
- # (if the path is not absolute). The absolute path cannot be DOS-style,
- # because $ac_f cannot contain `:'.
- test -f "$ac_f" ||
- case $ac_f in
- [\\/$]*) false;;
- *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
- esac ||
- { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
-echo "$as_me: error: cannot find input file: $ac_f" >&2;}
- { (exit 1); exit 1; }; };;
- esac
- ac_file_inputs="$ac_file_inputs $ac_f"
- done
-
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- configure_input="Generated from "`IFS=:
- echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
- if test x"$ac_file" != x-; then
- configure_input="$ac_file. $configure_input"
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- fi
-
- case $ac_tag in
- *:-:* | *:-) cat >"$tmp/stdin";;
- esac
- ;;
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- ac_dir=`$as_dirname -- "$ac_file" ||
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- { as_dir="$ac_dir"
- case $as_dir in #(
- -*) as_dir=./$as_dir;;
- esac
- test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
as_dirs=
- while :; do
- case $as_dir in #(
- *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
- *) as_qdir=$as_dir;;
- esac
- as_dirs="'$as_qdir' $as_dirs"
- as_dir=`$as_dirname -- "$as_dir" ||
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
- test -d "$as_dir" && break
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
done
- test -z "$as_dirs" || eval "mkdir $as_dirs"
- } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
-echo "$as_me: error: cannot create directory $as_dir" >&2;}
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
{ (exit 1); exit 1; }; }; }
+
ac_builddir=.
-case "$ac_dir" in
-.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
-*)
+if test "$ac_dir" != .; then
ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A ".." for each directory in $ac_dir_suffix.
- ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
- case $ac_top_builddir_sub in
- "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
- *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
- esac ;;
-esac
-ac_abs_top_builddir=$ac_pwd
-ac_abs_builddir=$ac_pwd$ac_dir_suffix
-# for backward compatibility:
-ac_top_builddir=$ac_top_build_prefix
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
case $srcdir in
- .) # We are building in place.
+ .) # No --srcdir option. We are building in place.
ac_srcdir=.
- ac_top_srcdir=$ac_top_builddir_sub
- ac_abs_top_srcdir=$ac_pwd ;;
- [\\/]* | ?:[\\/]* ) # Absolute name.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir
- ac_abs_top_srcdir=$srcdir ;;
- *) # Relative name.
- ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_build_prefix$srcdir
- ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
esac
-ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
- case $ac_mode in
- :F)
- #
- # CONFIG_FILE
- #
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
esac
-_ACEOF
-
-cat >>$CONFIG_STATUS <<\_ACEOF
-# If the template does not know about datarootdir, expand it.
-# FIXME: This hack should be removed a few years after 2.60.
-ac_datarootdir_hack=; ac_datarootdir_seen=
-case `sed -n '/datarootdir/ {
- p
- q
-}
-/@datadir@/p
-/@docdir@/p
-/@infodir@/p
-/@localedir@/p
-/@mandir@/p
-' $ac_file_inputs` in
-*datarootdir*) ac_datarootdir_seen=yes;;
-*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
- { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
-echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
-_ACEOF
-cat >>$CONFIG_STATUS <<_ACEOF
- ac_datarootdir_hack='
- s&@datadir@&$datadir&g
- s&@docdir@&$docdir&g
- s&@infodir@&$infodir&g
- s&@localedir@&$localedir&g
- s&@mandir@&$mandir&g
- s&\\\${datarootdir}&$datarootdir&g' ;;
-esac
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
_ACEOF
-
-# Neutralize VPATH when `$srcdir' = `.'.
-# Shell code in configure.ac might set extrasub.
-# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF
sed "$ac_vpsub
$extrasub
@@ -7661,137 +6769,251 @@ _ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s&@configure_input@&$configure_input&;t t
-s&@top_builddir@&$ac_top_builddir_sub&;t t
-s&@srcdir@&$ac_srcdir&;t t
-s&@abs_srcdir@&$ac_abs_srcdir&;t t
-s&@top_srcdir@&$ac_top_srcdir&;t t
-s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
-s&@builddir@&$ac_builddir&;t t
-s&@abs_builddir@&$ac_abs_builddir&;t t
-s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
-s&@INSTALL@&$ac_INSTALL&;t t
-$ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
-
-test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
- { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
- { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
- { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&5
-echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
-which seems to be undefined. Please make sure it is defined." >&2;}
-
- rm -f "$tmp/stdin"
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
+ac_uB='$,\1#\2define\3'
+ac_uC=' '
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
case $ac_file in
- -) cat "$tmp/out"; rm -f "$tmp/out";;
- *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- ;;
- :H)
- #
- # CONFIG_HEADER
- #
-_ACEOF
-
-# Transform confdefs.h into a sed script `conftest.defines', that
-# substitutes the proper values into config.h.in to produce config.h.
-rm -f conftest.defines conftest.tail
-# First, append a space to every undef/define line, to ease matching.
-echo 's/$/ /' >conftest.defines
-# Then, protect against being on the right side of a sed subst, or in
-# an unquoted here document, in config.status. If some macros were
-# called several times there might be several #defines for the same
-# symbol, which is useless. But do not sort them, since the last
-# AC_DEFINE must be honored.
-ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
-# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
-# NAME is the cpp macro being defined, VALUE is the value it is being given.
-# PARAMS is the parameter list in the macro definition--in most cases, it's
-# just an empty string.
-ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
-ac_dB='\\)[ (].*,\\1define\\2'
-ac_dC=' '
-ac_dD=' ,'
-
-uniq confdefs.h |
- sed -n '
- t rset
- :rset
- s/^[ ]*#[ ]*define[ ][ ]*//
- t ok
- d
- :ok
- s/[\\&,]/\\&/g
- s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
- s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
- ' >>conftest.defines
-
-# Remove the space that was appended to ease matching.
-# Then replace #undef with comments. This is necessary, for
+
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# And first: Protect against being on the right side of a sed subst in
+# config.status. Protect against being in an unquoted here document
+# in config.status.
+rm -f conftest.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
+
+# This sed command replaces #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
-# (The regexp can be short, since the line contains either #define or #undef.)
-echo 's/ $//
-s,^[ #]*u.*,/* & */,' >>conftest.defines
-
-# Break up conftest.defines:
-ac_max_sed_lines=50
-
-# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
-# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
-# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
-# et cetera.
-ac_in='$ac_file_inputs'
-ac_out='"$tmp/out1"'
-ac_nxt='"$tmp/out2"'
-
-while :
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
do
- # Write a here document:
- cat >>$CONFIG_STATUS <<_ACEOF
- # First, check the format of the line:
- cat >"\$tmp/defines.sed" <<\\CEOF
-/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
-/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
-b
-:def
-_ACEOF
- sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
echo 'CEOF
- sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
- ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
- sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
- grep . conftest.tail >/dev/null || break
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
rm -f conftest.defines
mv conftest.tail conftest.defines
done
-rm -f conftest.defines conftest.tail
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.undefs >/dev/null
+do
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
-echo "ac_result=$ac_in" >>$CONFIG_STATUS
cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.h
+ else
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
+ fi
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
if test x"$ac_file" != x-; then
- echo "/* $configure_input */" >"$tmp/config.h"
- cat "$ac_result" >>"$tmp/config.h"
- if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
{ echo "$as_me:$LINENO: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
rm -f $ac_file
- mv "$tmp/config.h" $ac_file
+ mv $tmp/config.h $ac_file
fi
else
- echo "/* $configure_input */"
- cat "$ac_result"
+ cat $tmp/config.h
+ rm -f $tmp/config.h
fi
- rm -f "$tmp/out12"
- ;;
-
-
- esac
-
-done # for ac_tag
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
{ (exit 0); exit 0; }
_ACEOF
diff --git a/devel/bmake/files/configure.in b/devel/bmake/files/configure.in
index a2302930e49..ef3220d9d10 100644
--- a/devel/bmake/files/configure.in
+++ b/devel/bmake/files/configure.in
@@ -1,6 +1,6 @@
dnl
dnl RCSid:
-dnl $Id: configure.in,v 1.6 2007/09/21 13:12:30 rillig Exp $
+dnl $Id: configure.in,v 1.7 2008/03/09 19:54:29 joerg Exp $
dnl
dnl Process this file with autoconf to produce a configure script
dnl
@@ -8,26 +8,20 @@ AC_INIT(makefile.boot.in)
AC_CONFIG_HEADER(config.h)
dnl
-DEFAULT_CSH=/bin/csh
-DEFAULT_KSH=/bin/ksh
-DEFAULT_SH=/bin/sh
-DEFSHELL=1
AC_ARG_WITH(defshell,
-[ --with-defshell=SHELL explicitly set DEFSHELL to either /bin/sh or /bin/ksh],
+[ --with-defshell=SHELL use SHELL by default - must be sh compatible, use sh or ksh to pick the internal definitions],
[case "${withval}" in
yes) AC_MSG_ERROR(bad value ${withval} given for bmake DEFSHELL) ;;
no) ;;
-*) case "$with_defshell" in
- */csh) DEFSHELL=0; DEFAULT_CSH=$with_defshell;; # kidding right?
- */sh) DEFSHELL=1; DEFAULT_SH=$with_defshell;;
- */ksh) DEFSHELL=2; DEFAULT_KSH=$with_defshell;;
- esac
+*) case "$with_defshell" in
+ sh) DEFSHELL_INDEX=DEFSHELL_INDEX_SH;; # it's the default anyway
+ ksh) DEFSHELL_INDEX=DEFSHELL_INDEX_KSH;;
+ csh) DEFSHELL_INDEX=DEFSHELL_INDEX_CSH;; # kidding right?
+ *) defshell_path=$with_defshell;; # better be sh compatible!
+ esac
;;
-esac])
-AC_DEFINE_UNQUOTED(DEFSHELL, ${DEFSHELL}, Shell spec to use by default)
-AC_SUBST(DEFAULT_CSH)
-AC_SUBST(DEFAULT_KSH)
-AC_SUBST(DEFAULT_SH)
+ esac])
+dnl
dnl
dnl Checks for programs.
AC_PROG_CC
@@ -99,6 +93,7 @@ AC_FUNC_WAIT3
dnl Keep this list sorted
AC_CHECK_FUNCS( \
asprintf \
+ emalloc \
getcwd \
getenv \
getopt \
@@ -111,10 +106,13 @@ AC_CHECK_FUNCS( \
sigvec \
snprintf \
strdup \
+ estrndup \
+ strndup \
strerror \
strftime \
strtod \
strtol \
+ unsetenv \
vasprintf \
vsnprintf \
wait3 \
@@ -215,20 +213,18 @@ echo "Using: ${force_machine}MACHINE=$machine, MACHINE_ARCH=$machine_arch" 1>&6
dnl
dnl Allow folk to control _PATH_DEFSYSPATH
dnl
-DEFAULT_SYS_PATH=\${prefix}/share/mk
+default_sys_path=\${prefix}/share/mk
AC_ARG_WITH(default-sys-path,
-[ --with-default-sys-path=PATH:DIR:LIST use an explicit DEFAULT_SYS_PATH
+[ --with-default-sys-path=PATH:DIR:LIST use an explicit _PATH_DEFSYSPATH
MAKESYSPATH is a ':' separated list of directories
that bmake will search for system .mk files.
- DEFAULT_SYS_PATH is its default value.],
+ _PATH_DEFSYSPATH is its default value.],
[case "${withval}" in
-yes) AC_MSG_ERROR(bad value ${withval} given for bmake DEFAULT_SYS_PATH) ;;
+yes) AC_MSG_ERROR(bad value ${withval} given for bmake _PATH_DEFSYSPATH) ;;
no) ;;
-*) DEFAULT_SYS_PATH="$with_default_sys_path"
+*) default_sys_path="$with_default_sys_path"
;;
esac])
-AC_SUBST(DEFAULT_SYS_PATH)
-
dnl
dnl Some folk don't like this one
dnl
@@ -281,11 +277,23 @@ do
done
mksrc=`echo $mksrc | sed "s,$srcdir,\\\${srcdir},"`
echo "Using: MKSRC=$mksrc" 1>&6
+dnl On some systems we want a different default shell by default
+if test -x /usr/xpg4/bin/sh; then
+ defshell_path=${defshell_path:-/usr/xpg4/bin/sh}
+fi
+if test -n "$defshell_path"; then
+ echo "Using: SHELL=$defshell_path" >&6
+ AC_DEFINE_UNQUOTED(DEFSHELL_CUSTOM, "$defshell_path", Path of default shell)
+fi
+if test -n "$DEFSHELL_INDEX"; then
+ AC_DEFINE_UNQUOTED(DEFSHELL_INDEX, $DEFSHELL_INDEX, Shell spec to use by default)
+fi
dnl
AC_SUBST(machine)
AC_SUBST(force_machine)
AC_SUBST(machine_arch)
AC_SUBST(mksrc)
+AC_SUBST(default_sys_path)
AC_SUBST(INSTALL)
AC_SUBST(GCC)
AC_SUBST(diff_u)
diff --git a/devel/bmake/files/dir.c b/devel/bmake/files/dir.c
index 530d70c7b64..4afbe61e651 100644
--- a/devel/bmake/files/dir.c
+++ b/devel/bmake/files/dir.c
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.c,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $ */
+/* $NetBSD: dir.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: dir.c,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $";
+static char rcsid[] = "$NetBSD: dir.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)dir.c 8.2 (Berkeley) 1/2/94";
#else
-__RCSID("$NetBSD: dir.c,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $");
+__RCSID("$NetBSD: dir.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/dir.h b/devel/bmake/files/dir.h
index 48c9e221ff3..6426e5d20a6 100644
--- a/devel/bmake/files/dir.h
+++ b/devel/bmake/files/dir.h
@@ -1,4 +1,4 @@
-/* $NetBSD: dir.h,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $ */
+/* $NetBSD: dir.h,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
diff --git a/devel/bmake/files/for.c b/devel/bmake/files/for.c
index 085c49cf012..96ed16acbf0 100644
--- a/devel/bmake/files/for.c
+++ b/devel/bmake/files/for.c
@@ -1,4 +1,4 @@
-/* $NetBSD: for.c,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $ */
+/* $NetBSD: for.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1992, The Regents of the University of California.
@@ -30,14 +30,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: for.c,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $";
+static char rcsid[] = "$NetBSD: for.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)for.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: for.c,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $");
+__RCSID("$NetBSD: for.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/getenv.c b/devel/bmake/files/getenv.c
index 4ec96d04a4c..a6d9324e21c 100644
--- a/devel/bmake/files/getenv.c
+++ b/devel/bmake/files/getenv.c
@@ -38,7 +38,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)getenv.c 5.8 (Berkeley) 2/23/91";*/
-static char *rcsid = "$Id: getenv.c,v 1.1.1.1 2005/12/02 00:02:59 sjg Exp $";
+static char *rcsid = "$Id: getenv.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdlib.h>
diff --git a/devel/bmake/files/getopt.c b/devel/bmake/files/getopt.c
index 4a82ed7b373..1b556bdf238 100644
--- a/devel/bmake/files/getopt.c
+++ b/devel/bmake/files/getopt.c
@@ -38,7 +38,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/* static char sccsid[] = "from: @(#)getopt.c 8.2 (Berkeley) 4/2/94"; */
-static char *rcsid = "$Id: getopt.c,v 1.1.1.1 2005/12/02 00:02:59 sjg Exp $";
+static char *rcsid = "$Id: getopt.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stdio.h>
diff --git a/devel/bmake/files/hash.c b/devel/bmake/files/hash.c
index 98b604edd9d..7f13311ee42 100644
--- a/devel/bmake/files/hash.c
+++ b/devel/bmake/files/hash.c
@@ -1,4 +1,4 @@
-/* $NetBSD: hash.c,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $ */
+/* $NetBSD: hash.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: hash.c,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $";
+static char rcsid[] = "$NetBSD: hash.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)hash.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: hash.c,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $");
+__RCSID("$NetBSD: hash.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/hash.h b/devel/bmake/files/hash.h
index ee9610399a0..0374942fb99 100644
--- a/devel/bmake/files/hash.h
+++ b/devel/bmake/files/hash.h
@@ -1,4 +1,4 @@
-/* $NetBSD: hash.h,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $ */
+/* $NetBSD: hash.h,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
diff --git a/devel/bmake/files/install-sh b/devel/bmake/files/install-sh
index 6272a6708e6..b42dd102237 100755
--- a/devel/bmake/files/install-sh
+++ b/devel/bmake/files/install-sh
@@ -53,7 +53,7 @@
#
# RCSid:
-# $Id: install-sh,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $
+# $Id: install-sh,v 1.2 2008/03/09 19:54:29 joerg Exp $
#
# @(#) Copyright (c) 1993 Simon J. Gerraty
#
diff --git a/devel/bmake/files/job.c b/devel/bmake/files/job.c
index c535bda77b7..36e98b8bf7f 100644
--- a/devel/bmake/files/job.c
+++ b/devel/bmake/files/job.c
@@ -1,4 +1,4 @@
-/* $NetBSD: job.c,v 1.5 2007/09/06 19:23:25 joerg Exp $ */
+/* $NetBSD: job.c,v 1.6 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.5 2007/09/06 19:23:25 joerg Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.6 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)job.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: job.c,v 1.5 2007/09/06 19:23:25 joerg Exp $");
+__RCSID("$NetBSD: job.c,v 1.6 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -94,8 +94,6 @@ __RCSID("$NetBSD: job.c,v 1.5 2007/09/06 19:23:25 joerg Exp $");
* frequently to keep the whole make going at
* a decent clip, since job table entries aren't
* removed until their process is caught this way.
- * Its single argument is TRUE if the function
- * should block waiting for a child to terminate.
*
* Job_CatchOutput Print any output our children have produced.
* Should also be called fairly frequently to
@@ -112,9 +110,6 @@ __RCSID("$NetBSD: job.c,v 1.5 2007/09/06 19:23:25 joerg Exp $");
*
* Job_End Cleanup any memory used.
*
- * Job_Empty Return TRUE if the job table is completely
- * empty.
- *
* Job_ParseShell Given the line following a .SHELL target, parse
* the line as a shell specification. Returns
* FAILURE if the spec was incorrect.
@@ -149,7 +144,6 @@ __RCSID("$NetBSD: job.c,v 1.5 2007/09/06 19:23:25 joerg Exp $");
#include <errno.h>
#include <fcntl.h>
-#ifndef RMT_WILL_WATCH
#if !defined(USE_SELECT) && defined(HAVE_POLL_H)
#include <poll.h>
#else
@@ -160,7 +154,6 @@ __RCSID("$NetBSD: job.c,v 1.5 2007/09/06 19:23:25 joerg Exp $");
# include <sys/select.h>
#endif
#endif
-#endif
#include <signal.h>
#include <stdio.h>
#include <string.h>
@@ -175,12 +168,7 @@ __RCSID("$NetBSD: job.c,v 1.5 2007/09/06 19:23:25 joerg Exp $");
#include "job.h"
#include "pathnames.h"
#include "trace.h"
-#ifdef REMOTE
-#include "rmt.h"
-# define STATIC
-#else
# define STATIC static
-#endif
/*
* error handling variables
@@ -190,6 +178,13 @@ static int aborting = 0; /* why is the make aborting? */
#define ABORT_ERROR 1 /* Because of an error */
#define ABORT_INTERRUPT 2 /* Because it was interrupted */
#define ABORT_WAIT 3 /* Waiting for jobs to finish */
+#define JOB_TOKENS "+EI+" /* Token to requeue for each abort state */
+
+/*
+ * this tracks the number of tokens currently "out" to build jobs.
+ */
+int jobTokensRunning = 0;
+int not_parallel = 0; /* set if .NOT_PARALLEL */
/*
* XXX: Avoid SunOS bug... FILENO() is fp->_file, and file
@@ -215,34 +210,63 @@ static int numCommands; /* The number of commands actually printed
#define JOB_RUNNING 0 /* Job is running */
#define JOB_ERROR 1 /* Error in starting the job */
#define JOB_FINISHED 2 /* The job is already finished */
-#define JOB_STOPPED 3 /* The job is stopped */
-
-
/*
* Descriptions for various shells.
+ *
+ * The build environment may set DEFSHELL_INDEX to one of
+ * DEFSHELL_INDEX_SH, DEFSHELL_INDEX_KSH, or DEFSHELL_INDEX_CSH, to
+ * select one of the prefedined shells as the default shell.
+ *
+ * Alternatively, the build environment may set DEFSHELL_CUSTOM to the
+ * name or the full path of a sh-compatible shell, which will be used as
+ * the default shell.
+ *
+ * ".SHELL" lines in Makefiles can choose the default shell from the
+ # set defined here, or add additional shells.
*/
+
+#ifdef DEFSHELL_CUSTOM
+#define DEFSHELL_INDEX_CUSTOM 0
+#define DEFSHELL_INDEX_SH 1
+#define DEFSHELL_INDEX_KSH 2
+#define DEFSHELL_INDEX_CSH 3
+#else /* !DEFSHELL_CUSTOM */
+#define DEFSHELL_INDEX_SH 0
+#define DEFSHELL_INDEX_KSH 1
+#define DEFSHELL_INDEX_CSH 2
+#endif /* !DEFSHELL_CUSTOM */
+
+#ifndef DEFSHELL_INDEX
+#define DEFSHELL_INDEX 0 /* DEFSHELL_INDEX_CUSTOM or DEFSHELL_INDEX_SH */
+#endif /* !DEFSHELL_INDEX */
+
static Shell shells[] = {
+#ifdef DEFSHELL_CUSTOM
/*
- * CSH description. The csh can do echo control by playing
- * with the setting of the 'echo' shell variable. Sadly,
- * however, it is unable to do error control nicely.
+ * An sh-compatible shell with a non-standard name.
+ *
+ * Keep this in sync with the "sh" description below, but avoid
+ * non-portable features that might not be supplied by all
+ * sh-compatible shells.
*/
{
- DEFAULT_CSH, "csh",
- TRUE, "unset verbose", "set verbose", "unset verbose", 10,
- FALSE, "echo \"%s\"\n", "csh -c \"%s || exit 0\"\n", "", '#',
- "v", "e",
+ DEFSHELL_CUSTOM,
+ FALSE, "", "", "", 0,
+ FALSE, "echo \"%s\"\n", "%s\n", "{ %s \n} || exit $?\n", "'\n'", '#',
+ "",
+ "",
},
+#endif /* DEFSHELL_CUSTOM */
/*
* SH description. Echo control is also possible and, under
* sun UNIX anyway, one can even control error checking.
*/
{
- DEFAULT_SH, "sh",
+ "sh",
FALSE, "", "", "", 0,
- FALSE, "echo \"%s\"\n", "%s\n", "{ %s \n} || exit $?\n", '#',
-#ifdef __NetBSD__
+ FALSE, "echo \"%s\"\n", "%s\n", "{ %s \n} || exit $?\n", "'\n'", '#',
+#if defined(MAKE_NATIVE) && defined(__NetBSD__)
"q",
#else
"",
@@ -253,23 +277,34 @@ static Shell shells[] = {
* KSH description.
*/
{
- DEFAULT_KSH, "ksh",
+ "ksh",
TRUE, "set +v", "set -v", "set +v", 6,
- FALSE, "echo \"%s\"\n", "%s\n", "{ %s \n} || exit $?\n", '#',
+ FALSE, "echo \"%s\"\n", "%s\n", "{ %s \n} || exit $?\n", "'\n'", '#',
"v",
"",
},
/*
+ * CSH description. The csh can do echo control by playing
+ * with the setting of the 'echo' shell variable. Sadly,
+ * however, it is unable to do error control nicely.
+ */
+{
+ "csh",
+ TRUE, "unset verbose", "set verbose", "unset verbose", 10,
+ FALSE, "echo \"%s\"\n", "csh -c \"%s || exit 0\"\n", "", "'\\\n'", '#',
+ "v", "e",
+},
+ /*
* UNKNOWN.
*/
{
- NULL, NULL,
- FALSE, NULL, NULL, NULL, 0,
+ NULL,
FALSE, NULL, NULL, NULL, 0,
+ FALSE, NULL, NULL, NULL, NULL, 0,
NULL, NULL,
}
};
-static Shell *commandShell = &shells[DEFSHELL];/* this is the shell to
+static Shell *commandShell = &shells[DEFSHELL_INDEX]; /* this is the shell to
* which we pass all
* commands in the Makefile.
* It is set by the
@@ -280,108 +315,55 @@ const char *shellPath = NULL, /* full pathname of
static const char *shellArgv = NULL; /* Custom shell args */
-static int maxJobs; /* The most children we can run at once */
-static int maxLocal; /* The most local ones we can have */
-STATIC int nJobs; /* The number of children currently running */
-STATIC int nLocal; /* The number of local children */
-STATIC Lst jobs; /* The structures that describe them */
-static Boolean wantToken; /* we want a token */
+STATIC Job *job_table; /* The structures that describe them */
+STATIC Job *job_table_end; /* job_table + maxJobs */
+static int wantToken; /* we want a token */
+static int lurking_children = 0;
+static int make_suspended = 0; /* non-zero if we've seen a SIGTSTP (etc) */
/*
* Set of descriptors of pipes connected to
* the output channels of children
*/
-#ifndef RMT_WILL_WATCH
static struct pollfd *fds = NULL;
static Job **jobfds = NULL;
static int nfds = 0;
-static int maxfds = 0;
static void watchfd(Job *);
static void clearfd(Job *);
static int readyfd(Job *);
-#define JBSTART 256
-#define JBFACTOR 2
-#endif
STATIC GNode *lastNode; /* The node for which output was most recently
* produced. */
STATIC const char *targFmt; /* Format string to use to head output from a
* job when it's not the most-recent job heard
* from */
+static char *targPrefix = NULL; /* What we print at the start of targFmt */
static Job tokenWaitJob; /* token wait pseudo-job */
-int job_pipe[2] = { -1, -1 }; /* job server pipes. */
static Job childExitJob; /* child exit pseudo-job */
-int exit_pipe[2] = { -1, -1 }; /* child exit signal pipe. */
-
-#ifdef REMOTE
-# define TARG_FMT "--- %s at %s ---\n" /* Default format */
-# define MESSAGE(fp, gn) \
- (void)fprintf(fp, targFmt, gn->name, gn->rem.hname)
-#else
-# define TARG_FMT "--- %s ---\n" /* Default format */
-# define MESSAGE(fp, gn) \
- (void)fprintf(fp, targFmt, gn->name)
-#endif
-
-/*
- * When JobStart attempts to run a job remotely but can't, and isn't allowed
- * to run the job locally, or when Job_CatchChildren detects a job that has
- * been migrated home, the job is placed on the stoppedJobs queue to be run
- * when the next job finishes.
- */
-STATIC Lst stoppedJobs; /* Lst of Job structures describing
- * jobs that were stopped due to concurrency
- * limits or migration home */
-
+#define CHILD_EXIT "."
+#define DO_JOB_RESUME "R"
-sigset_t caught_signals; /* Set of signals we handle */
+#define TARG_FMT "%s %s ---\n" /* Default format */
+#define MESSAGE(fp, gn) \
+ (void)fprintf(fp, targFmt, targPrefix, gn->name)
-#if defined(USE_PGRP)
-# if defined(HAVE_KILLPG)
-# define KILL(pid, sig) killpg((pid), (sig))
-# else
-# define KILL(pid, sig) kill(-(pid), (sig))
-# endif
+static sigset_t caught_signals; /* Set of signals we handle */
+#if defined(SYSV)
+#define KILLPG(pid, sig) kill(-(pid), (sig))
#else
-# define KILL(pid, sig) kill((pid), (sig))
+#define KILLPG(pid, sig) killpg((pid), (sig))
#endif
-/*
- * Grmpf... There is no way to set bits of the wait structure
- * anymore with the stupid W*() macros. I liked the union wait
- * stuff much more. So, we devise our own macros... This is
- * really ugly, use dramamine sparingly. You have been warned.
- */
-#ifndef W_STOPCODE
-#define W_STOPCODE(sig) (((sig) << 8) | 0177)
-#endif
-#ifndef W_EXITCODE
-#define W_EXITCODE(ret, sig) ((ret << 8) | (sig))
-#endif
-
-static int JobCondPassSig(ClientData, ClientData);
-static void JobPassSig(int);
static void JobChildSig(int);
-#ifdef USE_PGRP
static void JobContinueSig(int);
-#endif
-static int JobCmpPid(ClientData, ClientData);
+static Job *JobFindPid(int, int);
static int JobPrintCommand(ClientData, ClientData);
static int JobSaveCommand(ClientData, ClientData);
static void JobClose(Job *);
-#ifdef REMOTE
-static int JobCmpRmtID(ClientData, ClientData);
-# ifdef RMT_WILL_WATCH
-static void JobLocalInput(int, Job *);
-# endif
-#else
-static void JobFinish(Job *, WAIT_T);
static void JobExec(Job *, char **);
-#endif
static void JobMakeArgv(Job *, char **);
-static int JobRestart(Job *);
-static int JobStart(GNode *, int, Job *);
+static int JobStart(GNode *, int);
static char *JobOutput(Job *, char *, char *, int);
static void JobDoOutput(Job *, Boolean);
static Shell *JobMatchShell(const char *);
@@ -392,7 +374,19 @@ static void JobSigLock(sigset_t *);
static void JobSigUnlock(sigset_t *);
static void JobSigReset(void);
+const char *malloc_options="A";
+static void
+job_table_dump(const char *where)
+{
+ Job *job;
+
+ fprintf(debug_file, "job table @ %s\n", where);
+ for (job = job_table; job < job_table_end; job++) {
+ fprintf(debug_file, "job %d, status %d, flags %d, pid %d\n",
+ (int)(job - job_table), job->job_state, job->flags, job->pid);
+ }
+}
/*
* JobSigLock/JobSigUnlock
@@ -404,7 +398,7 @@ static void JobSigLock(sigset_t *omaskp)
{
if (sigprocmask(SIG_BLOCK, &caught_signals, omaskp) != 0) {
Punt("JobSigLock: sigprocmask: %s", strerror(errno));
- sigemptyset(omaskp);
+ sigemptyset(omaskp);
}
}
@@ -413,49 +407,69 @@ static void JobSigUnlock(sigset_t *omaskp)
(void)sigprocmask(SIG_SETMASK, omaskp, NULL);
}
+static void
+JobCreatePipe(Job *job, int minfd)
+{
+ int i, fd;
+
+ if (pipe(job->jobPipe) == -1)
+ Punt("Cannot create pipe: %s", strerror(errno));
+
+ /* Set close-on-exec flag for both */
+ (void)fcntl(job->jobPipe[0], F_SETFD, 1);
+ (void)fcntl(job->jobPipe[1], F_SETFD, 1);
+
+ /*
+ * We mark the input side of the pipe non-blocking; we poll(2) the
+ * pipe when we're waiting for a job token, but we might lose the
+ * race for the token when a new one becomes available, so the read
+ * from the pipe should not block.
+ */
+ fcntl(job->jobPipe[0], F_SETFL,
+ fcntl(job->jobPipe[0], F_GETFL, 0) | O_NONBLOCK);
+
+ for (i = 0; i < 2; i++) {
+ /* Avoid using low numbered fds */
+ fd = fcntl(job->jobPipe[i], F_DUPFD, minfd);
+ if (fd != -1) {
+ close(job->jobPipe[i]);
+ job->jobPipe[i] = fd;
+ }
+ }
+}
+
/*-
*-----------------------------------------------------------------------
* JobCondPassSig --
- * Pass a signal to a job if the job is remote or if USE_PGRP
- * is defined.
+ * Pass a signal to a job
*
* Input:
- * jobp Job to biff
* signop Signal to send it
*
- * Results:
- * === 0
- *
* Side Effects:
* None, except the job may bite it.
*
*-----------------------------------------------------------------------
*/
-static int
-JobCondPassSig(ClientData jobp, ClientData signop)
+static void
+JobCondPassSig(int signo)
{
- Job *job = (Job *)jobp;
- int signo = *(int *)signop;
-#ifdef RMT_WANTS_SIGNALS
- if (job->flags & JOB_REMOTE) {
- (void)Rmt_Signal(job, signo);
- } else {
- KILL(job->pid, signo);
- }
-#else
- /*
- * Assume that sending the signal to job->pid will signal any remote
- * job as well.
- */
+ Job *job;
+
if (DEBUG(JOB)) {
- (void)fprintf(stdout,
- "JobCondPassSig passing signal %d to child %d.\n",
- signo, job->pid);
- (void)fflush(stdout);
+ (void)fprintf(debug_file, "JobCondPassSig(%d) called.\n", signo);
+ }
+
+ for (job = job_table; job < job_table_end; job++) {
+ if (job->job_state != JOB_ST_RUNNING)
+ continue;
+ if (DEBUG(JOB)) {
+ (void)fprintf(debug_file,
+ "JobCondPassSig passing signal %d to child %d.\n",
+ signo, job->pid);
+ }
+ KILLPG(job->pid, signo);
}
- KILL(job->pid, signo);
-#endif
- return 0;
}
/*-
@@ -478,11 +492,10 @@ JobCondPassSig(ClientData jobp, ClientData signop)
static void
JobChildSig(int signo __unused)
{
- write(exit_pipe[1], ".", 1);
+ write(childExitJob.outPipe, CHILD_EXIT, 1);
}
-#ifdef USE_PGRP
/*-
*-----------------------------------------------------------------------
* JobContinueSig --
@@ -502,15 +515,17 @@ JobChildSig(int signo __unused)
static void
JobContinueSig(int signo __unused)
{
- JobRestartJobs();
+ /*
+ * Defer sending to SIGCONT to our stopped children until we return
+ * from the signal handler.
+ */
+ write(childExitJob.outPipe, DO_JOB_RESUME, 1);
}
-#endif
/*-
*-----------------------------------------------------------------------
* JobPassSig --
- * Pass a signal on to all remote jobs and to all local jobs if
- * USE_PGRP is defined, then die ourselves.
+ * Pass a signal on to all jobs, then resend to ourselves.
*
* Input:
* signo The signal number we've received
@@ -524,39 +539,31 @@ JobContinueSig(int signo __unused)
*-----------------------------------------------------------------------
*/
static void
-JobPassSig(int signo)
+JobPassSig_int(int signo)
+{
+ /* Run .INTERRUPT target then exit */
+ JobInterrupt(TRUE, signo);
+}
+
+static void
+JobPassSig_term(int signo)
+{
+ /* Dont run .INTERRUPT target then exit */
+ JobInterrupt(FALSE, signo);
+}
+
+static void
+JobPassSig_suspend(int signo)
{
sigset_t nmask, omask;
struct sigaction act;
- int sigcont;
- if (DEBUG(JOB)) {
- (void)fprintf(stdout, "JobPassSig(%d) called.\n", signo);
- (void)fflush(stdout);
- }
- Lst_ForEach(jobs, JobCondPassSig, (ClientData) &signo);
+ /* Suppress job started/continued messages */
+ make_suspended = 1;
- /*
- * Deal with proper cleanup based on the signal received. We only run
- * the .INTERRUPT target if the signal was in fact an interrupt. The other
- * three termination signals are more of a "get out *now*" command.
- */
- if (signo == SIGINT) {
- JobInterrupt(TRUE, signo);
- } else if ((signo == SIGHUP) || (signo == SIGTERM) || (signo == SIGQUIT)) {
- JobInterrupt(FALSE, signo);
- }
-
- /*
- * Leave gracefully if SIGQUIT, rather than core dumping.
- */
- if (signo == SIGQUIT) {
- Finish(0);
- }
+ /* Pass the signal onto every job */
+ JobCondPassSig(signo);
- if (signo == SIGTSTP) {
- Job_CatchChildren(FALSE);
- }
/*
* Send ourselves the signal now we've given the message to everyone else.
* Note we block everything else possible while we're getting the signal.
@@ -573,71 +580,67 @@ JobPassSig(int signo)
(void)sigaction(signo, &act, NULL);
if (DEBUG(JOB)) {
- (void)fprintf(stdout,
+ (void)fprintf(debug_file,
"JobPassSig passing signal %d to self.\n", signo);
- (void)fflush(stdout);
}
(void)kill(getpid(), signo);
- if (signo != SIGTSTP) {
- sigcont = SIGCONT;
- Lst_ForEach(jobs, JobCondPassSig, (ClientData) &sigcont);
- }
+
+ /*
+ * We've been continued.
+ *
+ * A whole host of signals continue to happen!
+ * SIGCHLD for any processes that actually suspended themselves.
+ * SIGCHLD for any processes that exited while we were alseep.
+ * The SIGCONT that actually caused us to wakeup.
+ *
+ * Since we defer passing the SIGCONT on to our children until
+ * the main processing loop, we can be sure that all the SIGCHLD
+ * events will have happened by then - and that the waitpid() will
+ * collect the child 'suspended' events.
+ * For correct sequencing we just need to ensure we process the
+ * waitpid() before passign on the SIGCONT.
+ *
+ * In any case nothing else is needed here.
+ */
/* Restore handler and signal mask */
- act.sa_handler = JobPassSig;
+ act.sa_handler = JobPassSig_suspend;
(void)sigaction(signo, &act, NULL);
(void)sigprocmask(SIG_SETMASK, &omask, NULL);
}
/*-
*-----------------------------------------------------------------------
- * JobCmpPid --
+ * JobFindPid --
* Compare the pid of the job with the given pid and return 0 if they
- * are equal. This function is called from Job_CatchChildren via
- * Lst_Find to find the job descriptor of the finished job.
+ * are equal. This function is called from Job_CatchChildren
+ * to find the job descriptor of the finished job.
*
* Input:
* job job to examine
* pid process id desired
*
* Results:
- * 0 if the pid's match
+ * Job with matching pid
*
* Side Effects:
* None
*-----------------------------------------------------------------------
*/
-static int
-JobCmpPid(ClientData job, ClientData pid)
+static Job *
+JobFindPid(int pid, int status)
{
- return *(int *)pid - ((Job *)job)->pid;
-}
+ Job *job;
-#ifdef REMOTE
-/*-
- *-----------------------------------------------------------------------
- * JobCmpRmtID --
- * Compare the rmtID of the job with the given rmtID and return 0 if they
- * are equal.
- *
- * Input:
- * job job to examine
- * rmtID remote id desired
- *
- * Results:
- * 0 if the rmtID's match
- *
- * Side Effects:
- * None.
- *-----------------------------------------------------------------------
- */
-static int
-JobCmpRmtID(ClientData job, ClientData rmtID)
-{
- return(*(int *)rmtID - ((Job *)job)->rmtID);
+ for (job = job_table; job < job_table_end; job++) {
+ if ((job->job_state == status) && job->pid == pid)
+ return job;
+ }
+ if (DEBUG(JOB))
+ job_table_dump("no pid");
+ return NULL;
}
-#endif
/*-
*-----------------------------------------------------------------------
@@ -696,15 +699,14 @@ JobPrintCommand(ClientData cmdp, ClientData jobp)
job->node->type |= OP_SAVE_CMDS;
if ((job->flags & JOB_IGNDOTS) == 0) {
job->tailCmds = Lst_Succ(Lst_Member(job->node->commands,
- (ClientData)cmd));
+ cmd));
return 1;
}
return 0;
}
#define DBPRINTF(fmt, arg) if (DEBUG(JOB)) { \
- (void)fprintf(stdout, fmt, arg); \
- (void)fflush(stdout); \
+ (void)fprintf(debug_file, fmt, arg); \
} \
(void)fprintf(job->cmdFILE, fmt, arg); \
(void)fflush(job->cmdFILE);
@@ -721,7 +723,7 @@ JobPrintCommand(ClientData cmdp, ClientData jobp)
while (*cmd == '@' || *cmd == '-' || (*cmd == '+')) {
switch (*cmd) {
case '@':
- shutUp = TRUE;
+ shutUp = DEBUG(LOUD) ? FALSE : TRUE;
break;
case '-':
errOff = TRUE;
@@ -732,7 +734,7 @@ JobPrintCommand(ClientData cmdp, ClientData jobp)
* We're not actually executing anything...
* but this one needs to be - use compat mode just for it.
*/
- CompatRunCommand(cmdp, (ClientData)job->node);
+ CompatRunCommand(cmdp, job->node);
return 0;
}
break;
@@ -907,7 +909,7 @@ JobPrintCommand(ClientData cmdp, ClientData jobp)
static int
JobSaveCommand(ClientData cmd, ClientData gn)
{
- cmd = (ClientData)Var_Subst(NULL, (char *)cmd, (GNode *)gn, FALSE);
+ cmd = Var_Subst(NULL, (char *)cmd, (GNode *)gn, FALSE);
(void)Lst_AtEnd(postCommands->commands, cmd);
return(0);
}
@@ -929,21 +931,13 @@ JobSaveCommand(ClientData cmd, ClientData gn)
static void
JobClose(Job *job)
{
- if (usePipes && (job->flags & JOB_FIRST)) {
-#ifdef RMT_WILL_WATCH
- Rmt_Ignore(job->inPipe);
-#else
- clearfd(job);
-#endif
- if (job->outPipe != job->inPipe) {
- (void)close(job->outPipe);
- }
- JobDoOutput(job, TRUE);
- (void)close(job->inPipe);
- } else {
- (void)close(job->outFd);
- JobDoOutput(job, TRUE);
- }
+ clearfd(job);
+ (void)close(job->outPipe);
+ job->outPipe = -1;
+
+ JobDoOutput(job, TRUE);
+ (void)close(job->inPipe);
+ job->inPipe = -1;
}
/*-
@@ -976,10 +970,15 @@ JobClose(Job *job)
static void
JobFinish (Job *job, WAIT_T status)
{
- Boolean done;
+ Boolean done, return_job_token;
+
+ if (DEBUG(JOB)) {
+ fprintf(debug_file, "Jobfinish: %d [%s], status %d\n",
+ job->pid, job->node->name, status);
+ }
if ((WIFEXITED(status) &&
- (((WEXITSTATUS(status) != 0) && !(job->flags & JOB_IGNERR)))) ||
+ (((WEXITSTATUS(status) != 0) && !(job->flags & JOB_IGNERR)))) ||
WIFSIGNALED(status))
{
/*
@@ -990,19 +989,12 @@ JobFinish (Job *job, WAIT_T status)
* cases, finish out the job's output before printing the exit
* status...
*/
-#ifdef REMOTE
- KILL(job->pid, SIGCONT);
-#endif
JobClose(job);
if (job->cmdFILE != NULL && job->cmdFILE != stdout) {
(void)fclose(job->cmdFILE);
job->cmdFILE = NULL;
}
done = TRUE;
-#ifdef REMOTE
- if (job->flags & JOB_REMOTE)
- Rmt_Done(job->rmtID, job->node);
-#endif
} else if (WIFEXITED(status)) {
/*
* Deal with ignored errors in -B mode. We need to print a message
@@ -1019,10 +1011,6 @@ JobFinish (Job *job, WAIT_T status)
* stuff?
*/
JobClose(job);
-#ifdef REMOTE
- if (job->flags & JOB_REMOTE)
- Rmt_Done(job->rmtID, job->node);
-#endif /* REMOTE */
} else {
/*
* No need to close things down or anything.
@@ -1030,187 +1018,54 @@ JobFinish (Job *job, WAIT_T status)
done = FALSE;
}
- if (done ||
- WIFSTOPPED(status) ||
- (WIFSIGNALED(status) && (WTERMSIG(status) == SIGCONT)))
- {
- FILE *out;
-
- if (compatMake && !usePipes && (job->flags & JOB_IGNERR)) {
- /*
- * If output is going to a file and this job is ignoring
- * errors, arrange to have the exit status sent to the
- * output file as well.
- */
- out = fdopen(job->outFd, "w");
- if (out == NULL)
- Punt("Cannot fdopen");
- } else {
- out = stdout;
- }
-
+ if (done) {
if (WIFEXITED(status)) {
if (DEBUG(JOB)) {
- (void)fprintf(stdout, "Process %d [%s] exited.\n",
+ (void)fprintf(debug_file, "Process %d [%s] exited.\n",
job->pid, job->node->name);
- (void)fflush(stdout);
}
if (WEXITSTATUS(status) != 0) {
- if (usePipes && job->node != lastNode) {
- MESSAGE(out, job->node);
+ if (job->node != lastNode) {
+ MESSAGE(stdout, job->node);
lastNode = job->node;
}
- (void)fprintf(out, "*** [%s] Error code %d%s\n",
+ (void)printf("*** [%s] Error code %d%s\n",
job->node->name,
WEXITSTATUS(status),
(job->flags & JOB_IGNERR) ? "(ignored)" : "");
-
- if (job->flags & JOB_IGNERR) {
+ if (job->flags & JOB_IGNERR)
WAIT_STATUS(status) = 0;
- }
} else if (DEBUG(JOB)) {
- if (usePipes && job->node != lastNode) {
- MESSAGE(out, job->node);
+ if (job->node != lastNode) {
+ MESSAGE(stdout, job->node);
lastNode = job->node;
}
- (void)fprintf(out, "*** [%s] Completed successfully\n",
+ (void)printf("*** [%s] Completed successfully\n",
job->node->name);
}
- } else if (WIFSTOPPED(status) && WSTOPSIG(status) != SIGCONT) {
- if (DEBUG(JOB)) {
- (void)fprintf(stdout, "Process %d (%s) stopped.\n",
- job->pid, job->node->name);
- (void)fflush(stdout);
- }
- if (usePipes && job->node != lastNode) {
- MESSAGE(out, job->node);
- lastNode = job->node;
- }
- if (!(job->flags & JOB_REMIGRATE)) {
- switch (WSTOPSIG(status)) {
- case SIGTSTP:
- (void)fprintf(out, "*** [%s] Suspended\n",
- job->node->name);
- break;
- case SIGSTOP:
- (void)fprintf(out, "*** [%s] Stopped\n",
- job->node->name);
- break;
- default:
- (void)fprintf(out, "*** [%s] Stopped -- signal %d\n",
- job->node->name, WSTOPSIG(status));
- }
- }
- job->flags |= JOB_RESUME;
- (void)Lst_AtEnd(stoppedJobs, (ClientData)job);
-#ifdef REMOTE
- if (job->flags & JOB_REMIGRATE)
- JobRestart(job);
-#endif
- (void)fflush(out);
- return;
- } else if (WIFSTOPPED(status) && WSTOPSIG(status) == SIGCONT) {
- /*
- * If the beastie has continued, shift the Job from the stopped
- * list to the running one (or re-stop it if concurrency is
- * exceeded) and go and get another child.
- */
- if (job->flags & (JOB_RESUME|JOB_REMIGRATE|JOB_RESTART)) {
- if (usePipes && job->node != lastNode) {
- MESSAGE(out, job->node);
- lastNode = job->node;
- }
- (void)fprintf(out, "*** [%s] Continued\n", job->node->name);
- }
- if (!(job->flags & JOB_CONTINUING)) {
- if (DEBUG(JOB)) {
- (void)fprintf(stdout,
- "Warning: process %d [%s] was not continuing.\n",
- job->pid, job->node->name);
- (void)fflush(stdout);
- }
-#ifdef notdef
- /*
- * We don't really want to restart a job from scratch just
- * because it continued, especially not without killing the
- * continuing process! That's why this is ifdef'ed out.
- * FD - 9/17/90
- */
- JobRestart(job);
-#endif
- }
- job->flags &= ~JOB_CONTINUING;
- Lst_AtEnd(jobs, (ClientData)job);
- nJobs += 1;
- if (!(job->flags & JOB_REMOTE)) {
- if (DEBUG(JOB)) {
- (void)fprintf(stdout,
- "Process %d is continuing locally.\n",
- job->pid);
- (void)fflush(stdout);
- }
- nLocal += 1;
- }
- (void)fflush(out);
- return;
} else {
- if (usePipes && job->node != lastNode) {
- MESSAGE(out, job->node);
+ if (job->node != lastNode) {
+ MESSAGE(stdout, job->node);
lastNode = job->node;
}
- (void)fprintf(out, "*** [%s] Signal %d\n",
+ (void)printf("*** [%s] Signal %d\n",
job->node->name, WTERMSIG(status));
}
-
- (void)fflush(out);
+ (void)fflush(stdout);
}
- /*
- * Now handle the -B-mode stuff. If the beast still isn't finished,
- * try and restart the job on the next command. If JobStart says it's
- * ok, it's ok. If there's an error, this puppy is done.
- */
- if (compatMake && (WIFEXITED(status) &&
- !Lst_IsAtEnd(job->node->commands))) {
- switch (JobStart(job->node, job->flags & JOB_IGNDOTS, job)) {
- case JOB_RUNNING:
- done = FALSE;
- break;
- case JOB_ERROR:
- done = TRUE;
- WSET_EXITCODE(status, 1, 0);
- break;
- case JOB_FINISHED:
- /*
- * If we got back a JOB_FINISHED code, JobStart has already
- * called Make_Update and freed the job descriptor. We set
- * done to false here to avoid fake cycles and double frees.
- * JobStart needs to do the update so we can proceed up the
- * graph when given the -n flag..
- */
- done = FALSE;
- break;
- }
- } else {
- done = TRUE;
- }
+ return_job_token = FALSE;
- if (done) {
- Trace_Log(JOBEND, job);
- if (!compatMake && !(job->flags & JOB_SPECIAL)) {
- if ((WAIT_STATUS(status) != 0) ||
- (aborting == ABORT_ERROR) ||
- (aborting == ABORT_INTERRUPT))
- Job_TokenReturn();
- }
-
+ Trace_Log(JOBEND, job);
+ if (!(job->flags & JOB_SPECIAL)) {
+ if ((WAIT_STATUS(status) != 0) ||
+ (aborting == ABORT_ERROR) ||
+ (aborting == ABORT_INTERRUPT))
+ return_job_token = TRUE;
}
- if (done &&
- (aborting != ABORT_ERROR) &&
- (aborting != ABORT_INTERRUPT) &&
- (WAIT_STATUS(status) == 0))
- {
+ if ((aborting != ABORT_ERROR) && (aborting != ABORT_INTERRUPT) &&
+ (WAIT_STATUS(status) == 0)) {
/*
* As long as we aren't aborting and the job didn't return a non-zero
* status that we shouldn't ignore, we call Make_Update to update
@@ -1220,18 +1075,17 @@ JobFinish (Job *job, WAIT_T status)
if (job->tailCmds != NILLNODE) {
Lst_ForEachFrom(job->node->commands, job->tailCmds,
JobSaveCommand,
- (ClientData)job->node);
+ job->node);
}
job->node->made = MADE;
if (!(job->flags & JOB_SPECIAL))
- Job_TokenReturn();
+ return_job_token = TRUE;
Make_Update(job->node);
- free(job);
+ job->job_state = JOB_ST_FREE;
} else if (WAIT_STATUS(status)) {
errors += 1;
- free(job);
+ job->job_state = JOB_ST_FREE;
}
- JobRestartJobs();
/*
* Set aborting if any error.
@@ -1245,7 +1099,10 @@ JobFinish (Job *job, WAIT_T status)
aborting = ABORT_ERROR;
}
- if ((aborting == ABORT_ERROR) && Job_Empty()) {
+ if (return_job_token)
+ Job_TokenReturn();
+
+ if (aborting == ABORT_ERROR && jobTokensRunning == 0) {
/*
* If we are aborting and the job table is now empty, we finish.
*/
@@ -1354,7 +1211,7 @@ Job_CheckCommands(GNode *gn, void (*abortProc)(const char *, ...))
* commands
*/
if ((DEFAULT != NILGNODE) && !Lst_IsEmpty(DEFAULT->commands) &&
- (gn->type & OP_SPECIAL) == 0) {
+ (gn->type & OP_SPECIAL) == 0) {
char *p1;
/*
* Make only looks for a .DEFAULT if the node was never the
@@ -1379,6 +1236,12 @@ Job_CheckCommands(GNode *gn, void (*abortProc)(const char *, ...))
*/
static const char msg[] = ": don't know how to make";
+ if (gn->flags & FROM_DEPEND) {
+ fprintf(stdout, "%s: ignoring stale .depend for %s\n",
+ progname, gn->name);
+ return TRUE;
+ }
+
if (gn->type & OP_OPTIONAL) {
(void)fprintf(stdout, "%s%s %s(ignored)\n", progname,
msg, gn->name);
@@ -1396,37 +1259,11 @@ Job_CheckCommands(GNode *gn, void (*abortProc)(const char *, ...))
}
return TRUE;
}
-#ifdef RMT_WILL_WATCH
-/*-
- *-----------------------------------------------------------------------
- * JobLocalInput --
- * Handle a pipe becoming readable. Callback function for Rmt_Watch
- *
- * Input:
- * stream Stream that's ready (ignored)
- * job Job to which the stream belongs
- *
- * Results:
- * None
- *
- * Side Effects:
- * JobDoOutput is called.
- *
- *-----------------------------------------------------------------------
- */
-/*ARGSUSED*/
-static void
-JobLocalInput(int stream, Job *job)
-{
- JobDoOutput(job, FALSE);
-}
-#endif /* RMT_WILL_WATCH */
/*-
*-----------------------------------------------------------------------
* JobExec --
- * Execute the shell for the given job. Called from JobStart and
- * JobRestart.
+ * Execute the shell for the given job. Called from JobStart
*
* Input:
* job Job to execute
@@ -1451,14 +1288,12 @@ JobExec(Job *job, char **argv)
if (DEBUG(JOB)) {
int i;
- (void)fprintf(stdout, "Running %s %sly\n", job->node->name,
- job->flags&JOB_REMOTE?"remote":"local");
- (void)fprintf(stdout, "\tCommand: ");
+ (void)fprintf(debug_file, "Running %s %sly\n", job->node->name, "local");
+ (void)fprintf(debug_file, "\tCommand: ");
for (i = 0; argv[i] != NULL; i++) {
- (void)fprintf(stdout, "%s ", argv[i]);
+ (void)fprintf(debug_file, "%s ", argv[i]);
}
- (void)fprintf(stdout, "\n");
- (void)fflush(stdout);
+ (void)fprintf(debug_file, "\n");
}
/*
@@ -1467,24 +1302,23 @@ JobExec(Job *job, char **argv)
* banner with their name in it never appears). This is an attempt to
* provide that feedback, even if nothing follows it.
*/
- if ((lastNode != job->node) && (job->flags & JOB_FIRST) &&
- !(job->flags & JOB_SILENT)) {
+ if ((lastNode != job->node) && !(job->flags & JOB_SILENT)) {
MESSAGE(stdout, job->node);
lastNode = job->node;
}
-#ifdef RMT_NO_EXEC
- if (job->flags & JOB_REMOTE) {
- goto jobExecFinish;
- }
-#endif /* RMT_NO_EXEC */
-
/* No interruptions until this job is on the `jobs' list */
JobSigLock(&mask);
- if ((cpid = vfork()) == -1) {
+ /* Pre-emptively mark job running, pid still zero though */
+ job->job_state = JOB_ST_RUNNING;
+
+ cpid = vfork();
+ if (cpid == -1)
Punt("Cannot vfork: %s", strerror(errno));
- } else if (cpid == 0) {
+
+ if (cpid == 0) {
+ /* Child */
/*
* Reset all signal handlers; this is necessary because we also
@@ -1512,29 +1346,17 @@ JobExec(Job *job, char **argv)
/*
* Pass job token pipe to submakes.
*/
- fcntl(job_pipe[0], F_SETFD, 0);
- fcntl(job_pipe[1], F_SETFD, 0);
+ fcntl(tokenWaitJob.inPipe, F_SETFD, 0);
+ fcntl(tokenWaitJob.outPipe, F_SETFD, 0);
}
- if (usePipes) {
- /*
- * Set up the child's output to be routed through the pipe
- * we've created for it.
- */
- if (dup2(job->outPipe, 1) == -1) {
- execError("dup2", "job->outPipe");
- _exit(1);
- }
- } else {
- /*
- * We're capturing output in a file, so we duplicate the
- * descriptor to the temporary file into the standard
- * output.
- */
- if (dup2(job->outFd, 1) == -1) {
- execError("dup2", "job->outFd");
- _exit(1);
- }
+ /*
+ * Set up the child's output to be routed through the pipe
+ * we've created for it.
+ */
+ if (dup2(job->outPipe, 1) == -1) {
+ execError("dup2", "job->outPipe");
+ _exit(1);
}
/*
* The output channels are marked close on exec. This bit was
@@ -1548,79 +1370,51 @@ JobExec(Job *job, char **argv)
_exit(1);
}
-#ifdef USE_PGRP
/*
* We want to switch the child into a different process family so
* we can kill it and all its descendants in one fell swoop,
* by killing its process family, but not commit suicide.
*/
-# if defined(SYSV)
+#if defined(SYSV)
+ /* XXX: dsl - I'm sure this should be setpgrp()... */
(void)setsid();
-# else
+#else
(void)setpgid(0, getpid());
-# endif
-#endif /* USE_PGRP */
+#endif
-#ifdef REMOTE
- if (job->flags & JOB_REMOTE) {
- Rmt_Exec(shellPath, argv, FALSE);
- } else
-#endif /* REMOTE */
- {
- (void)execv(shellPath, argv);
- execError("exec", shellPath);
- }
+ Var_ExportVars();
+
+ (void)execv(shellPath, argv);
+ execError("exec", shellPath);
_exit(1);
- } else {
- job->pid = cpid;
+ }
- Trace_Log(JOBSTART, job);
+ /* Parent, continuing after the child exec */
+ job->pid = cpid;
- if (usePipes && (job->flags & JOB_FIRST)) {
- /*
- * The first time a job is run for a node, we set the current
- * position in the buffer to the beginning and mark another
- * stream to watch in the outputs mask
- */
- job->curPos = 0;
+ Trace_Log(JOBSTART, job);
-#ifdef RMT_WILL_WATCH
- Rmt_Watch(job->inPipe, JobLocalInput, job);
-#else
- watchfd(job);
-#endif /* RMT_WILL_WATCH */
- }
+ /*
+ * Set the current position in the buffer to the beginning
+ * and mark another stream to watch in the outputs mask
+ */
+ job->curPos = 0;
- if (job->flags & JOB_REMOTE) {
-#ifndef REMOTE
- job->rmtID = 0;
-#else
- job->rmtID = Rmt_LastID(job->pid);
-#endif /* REMOTE */
- } else {
- nLocal += 1;
- /*
- * XXX: Used to not happen if REMOTE. Why?
- */
- if (job->cmdFILE != NULL && job->cmdFILE != stdout) {
- (void)fclose(job->cmdFILE);
- job->cmdFILE = NULL;
- }
- }
+ watchfd(job);
+
+ if (job->cmdFILE != NULL && job->cmdFILE != stdout) {
+ (void)fclose(job->cmdFILE);
+ job->cmdFILE = NULL;
}
-#ifdef RMT_NO_EXEC
-jobExecFinish:
-#endif
/*
* Now the job is actually running, add it to the table.
*/
if (DEBUG(JOB)) {
- printf("JobExec(%s): pid %d added to jobs table\n",
+ fprintf(debug_file, "JobExec(%s): pid %d added to jobs table\n",
job->node->name, job->pid);
+ job_table_dump("job started");
}
- nJobs += 1;
- (void)Lst_AtEnd(jobs, (ClientData)job);
JobSigUnlock(&mask);
}
@@ -1679,232 +1473,6 @@ JobMakeArgv(Job *job, char **argv)
/*-
*-----------------------------------------------------------------------
- * JobRestart --
- * Restart a job that stopped for some reason.
- *
- * Input:
- * job Job to restart
- *
- * Results:
- * 1 if max number of running jobs has been reached, 0 otherwise.
- *
- *-----------------------------------------------------------------------
- */
-static int
-JobRestart(Job *job)
-{
-#ifdef REMOTE
- int host;
-#endif
-
- if (job->flags & JOB_REMIGRATE) {
- if (
-#ifdef REMOTE
- verboseRemigrates ||
-#endif
- DEBUG(JOB)) {
- (void)fprintf(stdout, "*** remigrating %x(%s)\n",
- job->pid, job->node->name);
- (void)fflush(stdout);
- }
-
-#ifdef REMOTE
- if (!Rmt_ReExport(job->pid, job->node, &host)) {
- if (verboseRemigrates || DEBUG(JOB)) {
- (void)fprintf(stdout, "*** couldn't migrate...\n");
- (void)fflush(stdout);
- }
-#endif
- if (nLocal != maxLocal) {
- /*
- * Job cannot be remigrated, but there's room on the local
- * machine, so resume the job and note that another
- * local job has started.
- */
- if (
-#ifdef REMOTE
- verboseRemigrates ||
-#endif
- DEBUG(JOB)) {
- (void)fprintf(stdout, "*** resuming on local machine\n");
- (void)fflush(stdout);
- }
- KILL(job->pid, SIGCONT);
- nLocal +=1;
-#ifdef REMOTE
- job->flags &= ~(JOB_REMIGRATE|JOB_RESUME|JOB_REMOTE);
- job->flags |= JOB_CONTINUING;
-#else
- job->flags &= ~(JOB_REMIGRATE|JOB_RESUME);
-#endif
- } else {
- /*
- * Job cannot be restarted. Mark the table as full and
- * place the job back on the list of stopped jobs.
- */
- if (
-#ifdef REMOTE
- verboseRemigrates ||
-#endif
- DEBUG(JOB)) {
- (void)fprintf(stdout, "*** holding\n");
- (void)fflush(stdout);
- }
- (void)Lst_AtFront(stoppedJobs, (ClientData)job);
- return 1;
- }
-#ifdef REMOTE
- } else {
- /*
- * Clear out the remigrate and resume flags. Set the continuing
- * flag so we know later on that the process isn't exiting just
- * because of a signal.
- */
- job->flags &= ~(JOB_REMIGRATE|JOB_RESUME);
- job->flags |= JOB_CONTINUING;
- job->rmtID = host;
- }
-#endif
-
- (void)Lst_AtEnd(jobs, (ClientData)job);
- nJobs += 1;
- } else if (job->flags & JOB_RESTART) {
- /*
- * Set up the control arguments to the shell. This is based on the
- * flags set earlier for this job. If the JOB_IGNERR flag is clear,
- * the 'exit' flag of the commandShell is used to cause it to exit
- * upon receiving an error. If the JOB_SILENT flag is clear, the
- * 'echo' flag of the commandShell is used to get it to start echoing
- * as soon as it starts processing commands.
- */
- char *argv[10];
-
- JobMakeArgv(job, argv);
-
- if (DEBUG(JOB)) {
- (void)fprintf(stdout, "Restarting %s...", job->node->name);
- (void)fflush(stdout);
- }
-#ifdef REMOTE
- if ((job->node->type & OP_NOEXPORT) ||
- (nLocal < maxLocal && runLocalFirst)
-# ifdef RMT_NO_EXEC
- || !Rmt_Export(shellPath, argv, job)
-# else
- || !Rmt_Begin(shellPath, argv, job->node)
-# endif
- )
-#endif
- {
- if (((nLocal >= maxLocal) && !(job->flags & JOB_SPECIAL))) {
- /*
- * Can't be exported and not allowed to run locally -- put it
- * back on the hold queue and mark the table full
- */
- if (DEBUG(JOB)) {
- (void)fprintf(stdout, "holding\n");
- (void)fflush(stdout);
- }
- (void)Lst_AtFront(stoppedJobs, (ClientData)job);
- return 1;
- } else {
- /*
- * Job may be run locally.
- */
- if (DEBUG(JOB)) {
- (void)fprintf(stdout, "running locally\n");
- (void)fflush(stdout);
- }
- job->flags &= ~JOB_REMOTE;
- }
- }
-#ifdef REMOTE
- else {
- /*
- * Can be exported. Hooray!
- */
- if (DEBUG(JOB)) {
- (void)fprintf(stdout, "exporting\n");
- (void)fflush(stdout);
- }
- job->flags |= JOB_REMOTE;
- }
-#endif
- JobExec(job, argv);
- } else {
- /*
- * The job has stopped and needs to be restarted. Why it stopped,
- * we don't know...
- */
- if (DEBUG(JOB)) {
- (void)fprintf(stdout, "Resuming %s...", job->node->name);
- (void)fflush(stdout);
- }
- if ((nJobs != maxJobs) &&
- ((job->flags & JOB_REMOTE) ||
- (nLocal < maxLocal) ||
- ((maxLocal == 0) &&
- ((job->flags & JOB_SPECIAL)
-#ifdef REMOTE
- && (job->node->type & OP_NOEXPORT)
-#endif
- ))))
- {
- /*
- * If the job is remote, it's ok to resume it as long as the
- * maximum concurrency won't be exceeded. If it's local and
- * we haven't reached the local concurrency limit already (or the
- * job must be run locally and maxLocal is 0), it's also ok to
- * resume it.
- */
- Boolean error;
- WAIT_T status;
-
-#ifdef RMT_WANTS_SIGNALS
- if (job->flags & JOB_REMOTE) {
- error = !Rmt_Signal(job, SIGCONT);
- } else
-#endif /* RMT_WANTS_SIGNALS */
- error = (KILL(job->pid, SIGCONT) != 0);
-
- if (!error) {
- /*
- * Make sure the user knows we've continued the beast and
- * actually put the thing in the job table.
- */
- job->flags |= JOB_CONTINUING;
- WSET_STOPCODE(status, SIGCONT);
- JobFinish(job, status);
-
- job->flags &= ~(JOB_RESUME|JOB_CONTINUING);
- if (DEBUG(JOB)) {
- (void)fprintf(stdout, "done\n");
- (void)fflush(stdout);
- }
- } else {
- Error("couldn't resume %s: %s",
- job->node->name, strerror(errno));
- WSET_EXITCODE(status, 1, 0);
- JobFinish(job, status);
- }
- } else {
- /*
- * Job cannot be restarted. Mark the table as full and
- * place the job back on the list of stopped jobs.
- */
- if (DEBUG(JOB)) {
- (void)fprintf(stdout, "table full\n");
- (void)fflush(stdout);
- }
- (void)Lst_AtFront(stoppedJobs, (ClientData)job);
- return 1;
- }
- }
- return 0;
-}
-
-/*-
- *-----------------------------------------------------------------------
* JobStart --
* Start a target-creation process going for the target described
* by the graph node gn.
@@ -1923,28 +1491,30 @@ JobRestart(Job *job)
* Side Effects:
* A new Job node is created and added to the list of running
* jobs. PMake is forked and a child shell created.
+ *
+ * NB: I'm fairly sure that this code is never called with JOB_SPECIAL set
+ * JOB_IGNDOTS is never set (dsl)
+ * Also the return value is ignored by everyone.
*-----------------------------------------------------------------------
*/
static int
-JobStart(GNode *gn, int flags, Job *previous)
+JobStart(GNode *gn, int flags)
{
Job *job; /* new job descriptor */
char *argv[10]; /* Argument vector to shell */
Boolean cmdsOK; /* true if the nodes commands were all right */
- Boolean local; /* Set true if the job was run locally */
Boolean noExec; /* Set true if we decide not to run the job */
int tfd; /* File descriptor to the temp file */
- if (previous != NULL) {
- previous->flags &= ~(JOB_FIRST|JOB_IGNERR|JOB_SILENT|JOB_REMOTE);
- job = previous;
- } else {
- job = emalloc(sizeof(Job));
- if (job == NULL) {
- Punt("JobStart out of memory");
- }
- flags |= JOB_FIRST;
+ for (job = job_table; job < job_table_end; job++) {
+ if (job->job_state == JOB_ST_FREE)
+ break;
}
+ if (job >= job_table_end)
+ Punt("JobStart no job slots vacant");
+
+ memset(job, 0, sizeof *job);
+ job->job_state = JOB_ST_SETUP;
if (gn->type & OP_SPECIAL)
flags |= JOB_SPECIAL;
@@ -1969,15 +1539,9 @@ JobStart(GNode *gn, int flags, Job *previous)
* Check the commands now so any attributes from .DEFAULT have a chance
* to migrate to the node
*/
- if (!compatMake && job->flags & JOB_FIRST) {
- cmdsOK = Job_CheckCommands(gn, Error);
- } else {
- cmdsOK = TRUE;
- }
+ cmdsOK = Job_CheckCommands(gn, Error);
-#ifndef RMT_WILL_WATCH
job->inPollfd = NULL;
-#endif
/*
* If the -n flag wasn't given, we open up OUR (not the child's)
* temporary file to stuff commands in it. The thing is rd/wr so we don't
@@ -1985,7 +1549,7 @@ JobStart(GNode *gn, int flags, Job *previous)
* we just set the file to be stdout. Cute, huh?
*/
if (((gn->type & OP_MAKE) && !(noRecursiveExecute)) ||
- (!noExecute && !touchFlag)) {
+ (!noExecute && !touchFlag)) {
/*
* tfile is the name of a file into which all shell commands are
* put. It is used over by removing it before the child shell is
@@ -2022,59 +1586,17 @@ JobStart(GNode *gn, int flags, Job *previous)
noExec = FALSE;
/*
- * used to be backwards; replace when start doing multiple commands
- * per shell.
+ * We can do all the commands at once. hooray for sanity
*/
- if (compatMake) {
- /*
- * Be compatible: If this is the first time for this node,
- * verify its commands are ok and open the commands list for
- * sequential access by later invocations of JobStart.
- * Once that is done, we take the next command off the list
- * and print it to the command file. If the command was an
- * ellipsis, note that there's nothing more to execute.
- */
- if ((job->flags&JOB_FIRST) && (Lst_Open(gn->commands) != SUCCESS)){
- cmdsOK = FALSE;
- } else {
- LstNode ln = Lst_Next(gn->commands);
-
- if ((ln == NILLNODE) ||
- JobPrintCommand((ClientData)Lst_Datum(ln),
- (ClientData) job))
- {
- noExec = TRUE;
- Lst_Close(gn->commands);
- }
- if (noExec && !(job->flags & JOB_FIRST)) {
- /*
- * If we're not going to execute anything, the job
- * is done and we need to close down the various
- * file descriptors we've opened for output, then
- * call JobDoOutput to catch the final characters or
- * send the file to the screen... Note that the i/o streams
- * are only open if this isn't the first job.
- * Note also that this could not be done in
- * Job_CatchChildren b/c it wasn't clear if there were
- * more commands to execute or not...
- */
- JobClose(job);
- }
- }
- } else {
- /*
- * We can do all the commands at once. hooray for sanity
- */
- numCommands = 0;
- Lst_ForEach(gn->commands, JobPrintCommand, (ClientData)job);
+ numCommands = 0;
+ Lst_ForEach(gn->commands, JobPrintCommand, job);
- /*
- * If we didn't print out any commands to the shell script,
- * there's not much point in executing the shell, is there?
- */
- if (numCommands == 0) {
- noExec = TRUE;
- }
+ /*
+ * If we didn't print out any commands to the shell script,
+ * there's not much point in executing the shell, is there?
+ */
+ if (numCommands == 0) {
+ noExec = TRUE;
}
} else if (NoExecute(gn)) {
/*
@@ -2092,7 +1614,7 @@ JobStart(GNode *gn, int flags, Job *previous)
* doesn't do any harm in this case and may do some good.
*/
if (cmdsOK) {
- Lst_ForEach(gn->commands, JobPrintCommand, (ClientData)job);
+ Lst_ForEach(gn->commands, JobPrintCommand, job);
}
/*
* Don't execute the shell, thank you.
@@ -2109,11 +1631,15 @@ JobStart(GNode *gn, int flags, Job *previous)
Job_Touch(gn, job->flags&JOB_SILENT);
noExec = TRUE;
}
+ /* Just in case it isn't already... */
+ (void)fflush(job->cmdFILE);
/*
* If we're not supposed to execute a shell, don't.
*/
if (noExec) {
+ if (!(job->flags & JOB_SPECIAL))
+ Job_TokenReturn();
/*
* Unlink and close the command file if we opened one
*/
@@ -2122,34 +1648,23 @@ JobStart(GNode *gn, int flags, Job *previous)
(void)fclose(job->cmdFILE);
job->cmdFILE = NULL;
}
- } else {
- (void)fflush(stdout);
}
/*
* We only want to work our way up the graph if we aren't here because
* the commands for the job were no good.
*/
- if (cmdsOK) {
- if (aborting == 0) {
- if (job->tailCmds != NILLNODE) {
- Lst_ForEachFrom(job->node->commands, job->tailCmds,
- JobSaveCommand,
- (ClientData)job->node);
- }
- if (!(job->flags & JOB_SPECIAL))
- Job_TokenReturn();
- job->node->made = MADE;
- Make_Update(job->node);
+ if (cmdsOK && aborting == 0) {
+ if (job->tailCmds != NILLNODE) {
+ Lst_ForEachFrom(job->node->commands, job->tailCmds,
+ JobSaveCommand,
+ job->node);
}
- free(job);
- return(JOB_FINISHED);
- } else {
- free(job);
- return(JOB_ERROR);
+ job->node->made = MADE;
+ Make_Update(job->node);
}
- } else {
- (void)fflush(job->cmdFILE);
+ job->job_state = JOB_ST_FREE;
+ return cmdsOK ? JOB_FINISHED : JOB_ERROR;
}
/*
@@ -2158,66 +1673,10 @@ JobStart(GNode *gn, int flags, Job *previous)
*/
JobMakeArgv(job, argv);
- /*
- * If we're using pipes to catch output, create the pipe by which we'll
- * get the shell's output. If we're using files, print out that we're
- * starting a job and then set up its temporary-file name.
- */
- if (!compatMake || (job->flags & JOB_FIRST)) {
- if (usePipes) {
- int fd[2];
- if (pipe(fd) == -1)
- Punt("Cannot create pipe: %s", strerror(errno));
- job->inPipe = fd[0];
- job->outPipe = fd[1];
- (void)fcntl(job->inPipe, F_SETFD, 1);
- (void)fcntl(job->outPipe, F_SETFD, 1);
- } else {
- (void)fprintf(stdout, "Remaking `%s'\n", gn->name);
- (void)fflush(stdout);
- (void)strcpy(job->outFile, TMPPAT);
- job->outFd = mkstemp(job->outFile);
- (void)fcntl(job->outFd, F_SETFD, 1);
- }
- }
+ /* Create the pipe by which we'll get the shell's output. */
+ JobCreatePipe(job, 3);
-#ifdef REMOTE
- if (!(gn->type & OP_NOEXPORT) && !(runLocalFirst && nLocal < maxLocal)) {
-#ifdef RMT_NO_EXEC
- local = !Rmt_Export(shellPath, argv, job);
-#else
- local = !Rmt_Begin(shellPath, argv, job->node);
-#endif /* RMT_NO_EXEC */
- if (!local) {
- job->flags |= JOB_REMOTE;
- }
- } else
-#endif
- local = TRUE;
-
- if (local && (((nLocal >= maxLocal) &&
- !(job->flags & JOB_SPECIAL) &&
-#ifdef REMOTE
- (!(gn->type & OP_NOEXPORT) || (maxLocal != 0))
-#else
- (maxLocal != 0)
-#endif
- )))
- {
- /*
- * The job can only be run locally, but we've hit the limit of
- * local concurrency, so put the job on hold until some other job
- * finishes. Note that the special jobs (.BEGIN, .INTERRUPT and .END)
- * may be run locally even when the local limit has been reached
- * (e.g. when maxLocal == 0), though they will be exported if at
- * all possible. In addition, any target marked with .NOEXPORT will
- * be run locally if maxLocal is 0.
- */
- job->flags |= JOB_RESTART;
- (void)Lst_AtEnd(stoppedJobs, (ClientData)job);
- } else {
- JobExec(job, argv);
- }
+ JobExec(job, argv);
return(JOB_RUNNING);
}
@@ -2231,7 +1690,7 @@ JobOutput(Job *job, char *cp, char *endp, int msg)
while (ecp != NULL) {
if (cp != ecp) {
*ecp = '\0';
- if (msg && job->node != lastNode) {
+ if (!beSilent && msg && job->node != lastNode) {
MESSAGE(stdout, job->node);
lastNode = job->node;
}
@@ -2306,170 +1765,124 @@ JobDoOutput(Job *job, Boolean finish)
int max; /* limit for i (end of current data) */
int nRead; /* (Temporary) number of bytes read */
- FILE *oFILE; /* Stream pointer to shell's output file */
- char inLine[132];
-
-
- if (usePipes) {
- /*
- * Read as many bytes as will fit in the buffer.
- */
+ /*
+ * Read as many bytes as will fit in the buffer.
+ */
end_loop:
- gotNL = FALSE;
- fbuf = FALSE;
+ gotNL = FALSE;
+ fbuf = FALSE;
- nRead = read(job->inPipe, &job->outBuf[job->curPos],
- JOB_BUFSIZE - job->curPos);
- if (nRead < 0) {
- if (DEBUG(JOB)) {
- perror("JobDoOutput(piperead)");
- }
- nr = 0;
- } else {
- nr = nRead;
- }
-
- /*
- * If we hit the end-of-file (the job is dead), we must flush its
- * remaining output, so pretend we read a newline if there's any
- * output remaining in the buffer.
- * Also clear the 'finish' flag so we stop looping.
- */
- if ((nr == 0) && (job->curPos != 0)) {
- job->outBuf[job->curPos] = '\n';
- nr = 1;
- finish = FALSE;
- } else if (nr == 0) {
- finish = FALSE;
+ nRead = read(job->inPipe, &job->outBuf[job->curPos],
+ JOB_BUFSIZE - job->curPos);
+ if (nRead < 0) {
+ if (errno == EAGAIN)
+ return;
+ if (DEBUG(JOB)) {
+ perror("JobDoOutput(piperead)");
}
+ nr = 0;
+ } else {
+ nr = nRead;
+ }
- /*
- * Look for the last newline in the bytes we just got. If there is
- * one, break out of the loop with 'i' as its index and gotNL set
- * TRUE.
- */
- max = job->curPos + nr;
- for (i = job->curPos + nr - 1; i >= job->curPos; i--) {
- if (job->outBuf[i] == '\n') {
- gotNL = TRUE;
- break;
- } else if (job->outBuf[i] == '\0') {
- /*
- * Why?
- */
- job->outBuf[i] = ' ';
- }
- }
+ /*
+ * If we hit the end-of-file (the job is dead), we must flush its
+ * remaining output, so pretend we read a newline if there's any
+ * output remaining in the buffer.
+ * Also clear the 'finish' flag so we stop looping.
+ */
+ if ((nr == 0) && (job->curPos != 0)) {
+ job->outBuf[job->curPos] = '\n';
+ nr = 1;
+ finish = FALSE;
+ } else if (nr == 0) {
+ finish = FALSE;
+ }
- if (!gotNL) {
- job->curPos += nr;
- if (job->curPos == JOB_BUFSIZE) {
- /*
- * If we've run out of buffer space, we have no choice
- * but to print the stuff. sigh.
- */
- fbuf = TRUE;
- i = job->curPos;
- }
- }
- if (gotNL || fbuf) {
+ /*
+ * Look for the last newline in the bytes we just got. If there is
+ * one, break out of the loop with 'i' as its index and gotNL set
+ * TRUE.
+ */
+ max = job->curPos + nr;
+ for (i = job->curPos + nr - 1; i >= job->curPos; i--) {
+ if (job->outBuf[i] == '\n') {
+ gotNL = TRUE;
+ break;
+ } else if (job->outBuf[i] == '\0') {
/*
- * Need to send the output to the screen. Null terminate it
- * first, overwriting the newline character if there was one.
- * So long as the line isn't one we should filter (according
- * to the shell description), we print the line, preceded
- * by a target banner if this target isn't the same as the
- * one for which we last printed something.
- * The rest of the data in the buffer are then shifted down
- * to the start of the buffer and curPos is set accordingly.
+ * Why?
*/
- job->outBuf[i] = '\0';
- if (i >= job->curPos) {
- char *cp;
-
- cp = JobOutput(job, job->outBuf, &job->outBuf[i], FALSE);
-
- /*
- * There's still more in that thar buffer. This time, though,
- * we know there's no newline at the end, so we add one of
- * our own free will.
- */
- if (*cp != '\0') {
- if (job->node != lastNode) {
- MESSAGE(stdout, job->node);
- lastNode = job->node;
- }
- (void)fprintf(stdout, "%s%s", cp, gotNL ? "\n" : "");
- (void)fflush(stdout);
- }
- }
- if (i < max - 1) {
- /* shift the remaining characters down */
- (void)memcpy(job->outBuf, &job->outBuf[i + 1], max - (i + 1));
- job->curPos = max - (i + 1);
-
- } else {
- /*
- * We have written everything out, so we just start over
- * from the start of the buffer. No copying. No nothing.
- */
- job->curPos = 0;
- }
+ job->outBuf[i] = ' ';
}
- if (finish) {
+ }
+
+ if (!gotNL) {
+ job->curPos += nr;
+ if (job->curPos == JOB_BUFSIZE) {
/*
- * If the finish flag is true, we must loop until we hit
- * end-of-file on the pipe. This is guaranteed to happen
- * eventually since the other end of the pipe is now closed
- * (we closed it explicitly and the child has exited). When
- * we do get an EOF, finish will be set FALSE and we'll fall
- * through and out.
+ * If we've run out of buffer space, we have no choice
+ * but to print the stuff. sigh.
*/
- goto end_loop;
+ fbuf = TRUE;
+ i = job->curPos;
}
- } else {
+ }
+ if (gotNL || fbuf) {
/*
- * We've been called to retrieve the output of the job from the
- * temporary file where it's been squirreled away. This consists of
- * opening the file, reading the output line by line, being sure not
- * to print the noPrint line for the shell we used, then close and
- * remove the temporary file. Very simple.
- *
- * Change to read in blocks and do FindSubString type things as for
- * pipes? That would allow for "@echo -n..."
+ * Need to send the output to the screen. Null terminate it
+ * first, overwriting the newline character if there was one.
+ * So long as the line isn't one we should filter (according
+ * to the shell description), we print the line, preceded
+ * by a target banner if this target isn't the same as the
+ * one for which we last printed something.
+ * The rest of the data in the buffer are then shifted down
+ * to the start of the buffer and curPos is set accordingly.
*/
- oFILE = fopen(job->outFile, "r");
- if (oFILE != NULL) {
- (void)fprintf(stdout, "Results of making %s:\n", job->node->name);
- (void)fflush(stdout);
- while (fgets(inLine, sizeof(inLine), oFILE) != NULL) {
- char *cp, *endp, *oendp;
+ job->outBuf[i] = '\0';
+ if (i >= job->curPos) {
+ char *cp;
- cp = inLine;
- oendp = endp = inLine + strlen(inLine);
- if (endp[-1] == '\n') {
- *--endp = '\0';
- }
- cp = JobOutput(job, inLine, endp, FALSE);
+ cp = JobOutput(job, job->outBuf, &job->outBuf[i], FALSE);
- /*
- * There's still more in that thar buffer. This time, though,
- * we know there's no newline at the end, so we add one of
- * our own free will.
- */
- (void)fprintf(stdout, "%s", cp);
- (void)fflush(stdout);
- if (endp != oendp) {
- (void)fprintf(stdout, "\n");
- (void)fflush(stdout);
+ /*
+ * There's still more in that thar buffer. This time, though,
+ * we know there's no newline at the end, so we add one of
+ * our own free will.
+ */
+ if (*cp != '\0') {
+ if (!beSilent && job->node != lastNode) {
+ MESSAGE(stdout, job->node);
+ lastNode = job->node;
}
+ (void)fprintf(stdout, "%s%s", cp, gotNL ? "\n" : "");
+ (void)fflush(stdout);
}
- (void)fclose(oFILE);
- (void)eunlink(job->outFile);
+ }
+ if (i < max - 1) {
+ /* shift the remaining characters down */
+ (void)memcpy(job->outBuf, &job->outBuf[i + 1], max - (i + 1));
+ job->curPos = max - (i + 1);
+
} else {
- Punt("Cannot open `%s'", job->outFile);
+ /*
+ * We have written everything out, so we just start over
+ * from the start of the buffer. No copying. No nothing.
+ */
+ job->curPos = 0;
}
}
+ if (finish) {
+ /*
+ * If the finish flag is true, we must loop until we hit
+ * end-of-file on the pipe. This is guaranteed to happen
+ * eventually since the other end of the pipe is now closed
+ * (we closed it explicitly and the child has exited). When
+ * we do get an EOF, finish will be set FALSE and we'll fall
+ * through and out.
+ */
+ goto end_loop;
+ }
}
static void
@@ -2485,12 +1898,9 @@ JobRun(GNode *targ)
Lst_AtEnd(lst, targ);
(void)Make_Run(lst);
Lst_Destroy(lst, NOFREE);
- JobStart(targ, JOB_SPECIAL, NULL);
- while (nJobs) {
+ JobStart(targ, JOB_SPECIAL);
+ while (jobTokensRunning) {
Job_CatchOutput();
-#ifndef RMT_WILL_WATCH
- Job_CatchChildren(!usePipes);
-#endif /* RMT_WILL_WATCH */
}
#else
Compat_Make(targ, targ);
@@ -2518,67 +1928,62 @@ JobRun(GNode *targ)
* Notes:
* We do waits, blocking or not, according to the wisdom of our
* caller, until there are no more children to report. For each
- * job, call JobFinish to finish things off. This will take care of
- * putting jobs on the stoppedJobs queue.
+ * job, call JobFinish to finish things off.
*
*-----------------------------------------------------------------------
*/
+
void
-Job_CatchChildren(Boolean block)
+Job_CatchChildren(void)
{
int pid; /* pid of dead child */
Job *job; /* job descriptor for dead child */
- LstNode jnode; /* list element for finding job */
WAIT_T status; /* Exit/termination status */
/*
* Don't even bother if we know there's no one around.
*/
- if (nLocal == 0) {
+ if (jobTokensRunning == 0)
return;
- }
- while ((pid = waitpid((pid_t) -1, &status,
- (block?0:WNOHANG)|WUNTRACED)) > 0)
- {
+ while ((pid = waitpid((pid_t) -1, &status, WNOHANG | WUNTRACED)) > 0) {
if (DEBUG(JOB)) {
- (void)fprintf(stdout, "Process %d exited or stopped %x.\n", pid,
+ (void)fprintf(debug_file, "Process %d exited/stopped status %x.\n", pid,
WAIT_STATUS(status));
- (void)fflush(stdout);
}
- jnode = Lst_Find(jobs, (ClientData)&pid, JobCmpPid);
- if (jnode == NILLNODE) {
- if (WIFSTOPPED(status) && (WSTOPSIG(status) == SIGCONT)) {
- jnode = Lst_Find(stoppedJobs, (ClientData) &pid, JobCmpPid);
- if (jnode == NILLNODE) {
- Error("Resumed child (%d) not in table", pid);
- continue;
- }
- job = (Job *)Lst_Datum(jnode);
- (void)Lst_Remove(stoppedJobs, jnode);
- } else {
- Error("Child (%d) not in table?", pid);
- continue;
+ job = JobFindPid(pid, JOB_ST_RUNNING);
+ if (job == NULL) {
+ if (!lurking_children)
+ Error("Child (%d) status %x not in table?", pid, status);
+ continue;
+ }
+ if (WIFSTOPPED(status)) {
+ if (DEBUG(JOB)) {
+ (void)fprintf(debug_file, "Process %d (%s) stopped.\n",
+ job->pid, job->node->name);
}
- } else {
- job = (Job *)Lst_Datum(jnode);
- (void)Lst_Remove(jobs, jnode);
- nJobs -= 1;
-#ifdef REMOTE
- if (!(job->flags & JOB_REMOTE)) {
- if (DEBUG(JOB)) {
- (void)fprintf(stdout,
- "Job queue has one fewer local process.\n");
- (void)fflush(stdout);
- }
- nLocal -= 1;
+ if (!make_suspended) {
+ switch (WSTOPSIG(status)) {
+ case SIGTSTP:
+ (void)printf("*** [%s] Suspended\n", job->node->name);
+ break;
+ case SIGSTOP:
+ (void)printf("*** [%s] Stopped\n", job->node->name);
+ break;
+ default:
+ (void)printf("*** [%s] Stopped -- signal %d\n",
+ job->node->name, WSTOPSIG(status));
+ }
+ job->job_suspended = 1;
}
-#else
- nLocal -= 1;
-#endif
+ (void)fflush(stdout);
+ continue;
}
+ job->job_state = JOB_ST_FINISHED;
+ job->exit_status = WAIT_STATUS(status);
+
JobFinish(job, status);
}
}
@@ -2602,67 +2007,39 @@ Job_CatchChildren(Boolean block)
void
Job_CatchOutput(void)
{
- int nready;
- LstNode ln;
- Job *job;
-#ifdef RMT_WILL_WATCH
- int pnJobs; /* Previous nJobs */
-#endif
+ int nready;
+ Job *job;
+ int i;
(void)fflush(stdout);
- Job_TokenFlush();
-#ifdef RMT_WILL_WATCH
- pnJobs = nJobs;
- /*
- * It is possible for us to be called with nJobs equal to 0. This happens
- * if all the jobs finish and a job that is stopped cannot be run
- * locally (eg if maxLocal is 0) and cannot be exported. The job will
- * be placed back on the stoppedJobs queue, Job_Empty() will return false,
- * Make_Run will call us again when there's nothing for which to wait.
- * nJobs never changes, so we loop forever. Hence the check. It could
- * be argued that we should sleep for a bit so as not to swamp the
- * exportation system with requests. Perhaps we should.
- *
- * NOTE: IT IS THE RESPONSIBILITY OF Rmt_Wait TO CALL Job_CatchChildren
- * IN A TIMELY FASHION TO CATCH ANY LOCALLY RUNNING JOBS THAT EXIT.
- * It may use the variable nLocal to determine if it needs to call
- * Job_CatchChildren(if nLocal is 0, there's nothing for which to
- * wait...)
- */
- while (nJobs != 0 && pnJobs == nJobs) {
- Rmt_Wait();
+ /* The first fd in the list is the job token pipe */
+ nready = poll(fds + 1 - wantToken, nfds - 1 + wantToken, POLL_MSEC);
+
+ if (nready < 0 || readyfd(&childExitJob)) {
+ char token = 0;
+ nready -= 1;
+ (void)read(childExitJob.inPipe, &token, 1);
+ if (token == DO_JOB_RESUME[0])
+ /* Complete relay requested from our SIGCONT handler */
+ JobRestartJobs();
+ Job_CatchChildren();
}
-#else
- if (usePipes) {
- if ((nready = poll((wantToken ? fds : (fds + 1)),
- (wantToken ? nfds : (nfds - 1)), POLL_MSEC)) <= 0) {
- return;
- } else {
- sigset_t mask;
- JobSigLock(&mask);
- if (Lst_Open(jobs) == FAILURE) {
- Punt("Cannot open job table");
- }
- if (readyfd(&childExitJob)) {
- char token;
- (void)read(childExitJob.inPipe, &token, 1);
- nready -= 1;
- }
+ if (nready <= 0)
+ return;
- while (nready && (ln = Lst_Next(jobs)) != NILLNODE) {
- job = (Job *)Lst_Datum(ln);
- if (readyfd(job)) {
- JobDoOutput(job, FALSE);
- nready -= 1;
- }
- }
- Lst_Close(jobs);
- JobSigUnlock(&mask);
- }
+ if (wantToken && readyfd(&tokenWaitJob))
+ nready--;
+
+ for (i = 2; i < nfds; i++) {
+ if (!fds[i].revents)
+ continue;
+ job = jobfds[i];
+ if (job->job_state != JOB_ST_RUNNING)
+ continue;
+ JobDoOutput(job, FALSE);
}
-#endif /* RMT_WILL_WATCH */
}
/*-
@@ -2682,21 +2059,26 @@ Job_CatchOutput(void)
void
Job_Make(GNode *gn)
{
- (void)JobStart(gn, 0, NULL);
+ (void)JobStart(gn, 0);
}
void
-Shell_Init()
+Shell_Init(void)
{
if (shellPath == NULL) {
/*
- * The user didn't specify a shell to use, so we are using the
- * default one... Both the absolute path and the last component
- * must be set. The last component is taken from the 'name' field
- * of the default shell description pointed-to by commandShell.
+ * We are using the default shell, which may be an absolute
+ * path if DEFSHELL_CUSTOM is defined.
*/
shellName = commandShell->name;
- shellPath = commandShell->path;
+#ifdef DEFSHELL_CUSTOM
+ if (*shellName == '/') {
+ shellPath = shellName;
+ shellName = strrchr(shellPath, '/');
+ shellName++;
+ } else
+#endif
+ shellPath = str_concat(_PATH_DEFSHELLDIR, shellName, STR_ADDSLASH);
}
if (commandShell->exit == NULL) {
commandShell->exit = "";
@@ -2707,15 +2089,35 @@ Shell_Init()
}
/*-
+ * Returns the string literal that is used in the current command shell
+ * to produce a newline character.
+ */
+const char *
+Shell_GetNewline(void)
+{
+
+ return commandShell->newline;
+}
+
+void
+Job_SetPrefix(void)
+{
+
+ if (targPrefix) {
+ free(targPrefix);
+ } else if (!Var_Exists(MAKE_JOB_PREFIX, VAR_GLOBAL)) {
+ Var_Set(MAKE_JOB_PREFIX, "---", VAR_GLOBAL, 0);
+ }
+
+ targPrefix = Var_Subst(NULL, "${" MAKE_JOB_PREFIX "}", VAR_GLOBAL, 0);
+}
+
+/*-
*-----------------------------------------------------------------------
* Job_Init --
* Initialize the process module
*
* Input:
- * maxproc the greatest number of jobs which may be running
- * at one time
- * maxlocal the greatest number of jobs which may be running
- * at once
*
* Results:
* none
@@ -2725,28 +2127,22 @@ Shell_Init()
*-----------------------------------------------------------------------
*/
void
-Job_Init(int maxproc, int maxlocal)
+Job_Init(void)
{
GNode *begin; /* node for commands to do at the very start */
- jobs = Lst_Init(FALSE);
- stoppedJobs = Lst_Init(FALSE);
- maxJobs = maxproc;
- maxLocal = maxlocal;
- nJobs = 0;
- nLocal = 0;
- wantToken = FALSE;
+ /* Allocate space for all the job info */
+ job_table = emalloc(maxJobs * sizeof *job_table);
+ memset(job_table, 0, maxJobs * sizeof *job_table);
+ job_table_end = job_table + maxJobs;
+ wantToken = 0;
aborting = 0;
errors = 0;
lastNode = NILGNODE;
- if (maxJobs == 1
-#ifdef REMOTE
- || noMessages
-#endif
- ) {
+ if (maxJobs == 1) {
/*
* If only one job can run at a time, there's no need for a banner,
* is there?
@@ -2756,14 +2152,34 @@ Job_Init(int maxproc, int maxlocal)
targFmt = TARG_FMT;
}
+ /*
+ * There is a non-zero chance that we already have children.
+ * eg after 'make -f- <<EOF'
+ * Since their termination causes a 'Child (pid) not in table' message,
+ * Collect the status of any that are already dead, and suppress the
+ * error message if there are any undead ones.
+ */
+ for (;;) {
+ int rval, status;
+ rval = waitpid((pid_t) -1, &status, WNOHANG);
+ if (rval > 0)
+ continue;
+ if (rval == 0)
+ lurking_children = 1;
+ break;
+ }
+
Shell_Init();
- if (pipe(exit_pipe) < 0)
- Fatal("error in pipe: %s", strerror(errno));
- fcntl(exit_pipe[0], F_SETFD, 1);
- fcntl(exit_pipe[1], F_SETFD, 1);
+ JobCreatePipe(&childExitJob, 3);
- childExitJob.inPipe = exit_pipe[0];
+ /* We can only need to wait for tokens, children and output from each job */
+ fds = emalloc(sizeof (*fds) * (2 + maxJobs));
+ jobfds = emalloc(sizeof (*jobfds) * (2 + maxJobs));
+
+ /* These are permanent entries and take slots 0 and 1 */
+ watchfd(&tokenWaitJob);
+ watchfd(&childExitJob);
sigemptyset(&caught_signals);
/*
@@ -2782,10 +2198,10 @@ Job_Init(int maxproc, int maxlocal)
* Catch the four signals that POSIX specifies if they aren't ignored.
* JobPassSig will take care of calling JobInterrupt if appropriate.
*/
- ADDSIG(SIGINT, JobPassSig)
- ADDSIG(SIGHUP, JobPassSig)
- ADDSIG(SIGTERM, JobPassSig)
- ADDSIG(SIGQUIT, JobPassSig)
+ ADDSIG(SIGINT, JobPassSig_int)
+ ADDSIG(SIGHUP, JobPassSig_term)
+ ADDSIG(SIGTERM, JobPassSig_term)
+ ADDSIG(SIGQUIT, JobPassSig_term)
/*
* There are additional signals that need to be caught and passed if
@@ -2793,13 +2209,11 @@ Job_Init(int maxproc, int maxlocal)
* we're giving each job its own process group (since then it won't get
* signals from the terminal driver as we own the terminal)
*/
-#if defined(RMT_WANTS_SIGNALS) || defined(USE_PGRP)
- ADDSIG(SIGTSTP, JobPassSig)
- ADDSIG(SIGTTOU, JobPassSig)
- ADDSIG(SIGTTIN, JobPassSig)
- ADDSIG(SIGWINCH, JobPassSig)
+ ADDSIG(SIGTSTP, JobPassSig_suspend)
+ ADDSIG(SIGTTOU, JobPassSig_suspend)
+ ADDSIG(SIGTTIN, JobPassSig_suspend)
+ ADDSIG(SIGWINCH, JobCondPassSig)
ADDSIG(SIGCONT, JobContinueSig)
-#endif
#undef ADDSIG
begin = Targ_FindNode(".BEGIN", TARG_NOCREATE);
@@ -2818,61 +2232,24 @@ static void JobSigReset(void)
{
#define DELSIG(s) \
if (sigismember(&caught_signals, s)) { \
- (void)signal(SIGINT, SIG_DFL); \
+ (void)signal(s, SIG_DFL); \
}
DELSIG(SIGINT)
DELSIG(SIGHUP)
DELSIG(SIGQUIT)
DELSIG(SIGTERM)
-#if defined(RMT_WANTS_SIGNALS) || defined(USE_PGRP)
DELSIG(SIGTSTP)
DELSIG(SIGTTOU)
DELSIG(SIGTTIN)
DELSIG(SIGWINCH)
DELSIG(SIGCONT)
-#endif
#undef DELSIG
(void)signal(SIGCHLD, SIG_DFL);
}
/*-
*-----------------------------------------------------------------------
- * Job_Empty --
- * See if the job table is empty. Because the local concurrency may
- * be set to 0, it is possible for the job table to become empty,
- * while the list of stoppedJobs remains non-empty. In such a case,
- * we want to restart as many jobs as we can.
- *
- * Results:
- * TRUE if it is. FALSE if it ain't.
- *
- * Side Effects:
- * None.
- *
- * -----------------------------------------------------------------------
- */
-Boolean
-Job_Empty(void)
-{
- if (nJobs == 0) {
- if (!Lst_IsEmpty(stoppedJobs) && !aborting) {
- /*
- * The job table is obviously not full if it has no jobs in
- * it...Try and restart the stopped jobs.
- */
- JobRestartJobs();
- return(FALSE);
- } else {
- return(TRUE);
- }
- } else {
- return(FALSE);
- }
-}
-
-/*-
- *-----------------------------------------------------------------------
* JobMatchShell --
* Find a shell in 'shells' given its name.
*
@@ -2931,6 +2308,7 @@ JobMatchShell(const char *name)
* echoFlag Flag to turn echoing on at the start
* errFlag Flag to turn error checking on at the start
* hasErrCtl True if shell has error checking control
+ * newline String literal to represent a newline char
* check Command to turn on error checking if hasErrCtl
* is TRUE or template of command to echo a command
* for which error checking is off if hasErrCtl is
@@ -2989,6 +2367,8 @@ Job_ParseShell(char *line)
char c = argv[0][10];
newShell.hasErrCtl = !((c != 'Y') && (c != 'y') &&
(c != 'T') && (c != 't'));
+ } else if (strncmp(*argv, "newline=", 8) == 0) {
+ newShell.newline = &argv[0][8];
} else if (strncmp(*argv, "check=", 6) == 0) {
newShell.errCheck = &argv[0][6];
} else if (strncmp(*argv, "ignore=", 7) == 0) {
@@ -3104,20 +2484,19 @@ Job_ParseShell(char *line)
static void
JobInterrupt(int runINTERRUPT, int signo)
{
- LstNode ln; /* element in job table */
Job *job; /* job descriptor in that element */
GNode *interrupt; /* the node describing the .INTERRUPT target */
sigset_t mask;
+ GNode *gn;
aborting = ABORT_INTERRUPT;
JobSigLock(&mask);
- (void)Lst_Open(jobs);
- while ((ln = Lst_Next(jobs)) != NILLNODE) {
- GNode *gn;
+ for (job = job_table; job < job_table_end; job++) {
+ if (job->job_state != JOB_ST_RUNNING)
+ continue;
- job = (Job *)Lst_Datum(ln);
gn = job->node;
if ((gn->type & (OP_JOIN|OP_PHONY)) == 0 && !Targ_Precious(gn)) {
@@ -3126,99 +2505,15 @@ JobInterrupt(int runINTERRUPT, int signo)
Error("*** %s removed", file);
}
}
-#ifdef RMT_WANTS_SIGNALS
- if (job->flags & JOB_REMOTE) {
- /*
- * If job is remote, let the Rmt module do the killing.
- */
- if (!Rmt_Signal(job, signo)) {
- /*
- * If couldn't kill the thing, finish it out now with an
- * error code, since no exit report will come in likely.
- */
- WAIT_T status;
-
- WSET_EXITCODE(status, 1, 0);
- JobFinish(job, status);
- }
- } else if (job->pid) {
- KILL(job->pid, signo);
- }
-#else
if (job->pid) {
if (DEBUG(JOB)) {
- (void)fprintf(stdout,
+ (void)fprintf(debug_file,
"JobInterrupt passing signal %d to child %d.\n",
signo, job->pid);
- (void)fflush(stdout);
}
- KILL(job->pid, signo);
+ KILLPG(job->pid, signo);
}
-#endif /* RMT_WANTS_SIGNALS */
}
- Lst_Close(jobs);
-
-#ifdef REMOTE
- (void)Lst_Open(stoppedJobs);
- while ((ln = Lst_Next(stoppedJobs)) != NILLNODE) {
- GNode *gn;
-
- job = (Job *)Lst_Datum(ln);
- gn = job->node;
-
- if (job->flags & JOB_RESTART) {
- if (DEBUG(JOB)) {
- (void)fprintf(stdout, "%s%s",
- "JobInterrupt skipping job on stopped queue",
- "-- it was waiting to be restarted.\n");
- (void)fflush(stdout);
- }
- continue;
- }
- if ((gn->type & (OP_JOIN|OP_PHONY)) == 0 && !Targ_Precious(gn)) {
- char *file = (gn->path == NULL ? gn->name : gn->path);
- if (eunlink(file) == 0) {
- Error("*** %s removed", file);
- }
- }
- /*
- * Resume the thing so it will take the signal.
- */
- if (DEBUG(JOB)) {
- (void)fprintf(stdout,
- "JobInterrupt passing CONT to stopped child %d.\n",
- job->pid);
- (void)fflush(stdout);
- }
- KILL(job->pid, SIGCONT);
-#ifdef RMT_WANTS_SIGNALS
- if (job->flags & JOB_REMOTE) {
- /*
- * If job is remote, let the Rmt module do the killing.
- */
- if (!Rmt_Signal(job, SIGINT)) {
- /*
- * If couldn't kill the thing, finish it out now with an
- * error code, since no exit report will come in likely.
- */
- WAIT_T status;
-
- WSET_EXITCODE(status, 1, 0);
- JobFinish(job, status);
- }
- } else if (job->pid) {
- if (DEBUG(JOB)) {
- (void)fprintf(stdout,
- "JobInterrupt passing interrupt to stopped child %d.\n",
- job->pid);
- (void)fflush(stdout);
- }
- KILL(job->pid, SIGINT);
- }
-#endif /* RMT_WANTS_SIGNALS */
- }
- Lst_Close(stoppedJobs);
-#endif /* REMOTE */
JobSigUnlock(&mask);
@@ -3256,7 +2551,6 @@ Job_Finish(void)
JobRun(postCommands);
}
}
- Job_TokenFlush();
return(errors);
}
@@ -3299,13 +2593,9 @@ void
Job_Wait(void)
{
aborting = ABORT_WAIT;
- while (nJobs != 0) {
+ while (jobTokensRunning != 0) {
Job_CatchOutput();
-#ifndef RMT_WILL_WATCH
- Job_CatchChildren(!usePipes);
-#endif /* RMT_WILL_WATCH */
}
- Job_TokenFlush();
aborting = 0;
}
@@ -3326,39 +2616,22 @@ Job_Wait(void)
void
Job_AbortAll(void)
{
- LstNode ln; /* element in job table */
Job *job; /* the job descriptor in that element */
WAIT_T foo;
- sigset_t mask;
aborting = ABORT_ERROR;
- if (nJobs) {
-
- JobSigLock(&mask);
- (void)Lst_Open(jobs);
- while ((ln = Lst_Next(jobs)) != NILLNODE) {
- job = (Job *)Lst_Datum(ln);
-
+ if (jobTokensRunning) {
+ for (job = job_table; job < job_table_end; job++) {
+ if (job->job_state != JOB_ST_RUNNING)
+ continue;
/*
* kill the child process with increasingly drastic signals to make
* darn sure it's dead.
*/
-#ifdef RMT_WANTS_SIGNALS
- if (job->flags & JOB_REMOTE) {
- (void)Rmt_Signal(job, SIGINT);
- (void)Rmt_Signal(job, SIGKILL);
- } else {
- KILL(job->pid, SIGINT);
- KILL(job->pid, SIGKILL);
- }
-#else
- KILL(job->pid, SIGINT);
- KILL(job->pid, SIGKILL);
-#endif /* RMT_WANTS_SIGNALS */
+ KILLPG(job->pid, SIGINT);
+ KILLPG(job->pid, SIGKILL);
}
- Lst_Close(jobs);
- JobSigUnlock(&mask);
}
/*
@@ -3368,123 +2641,54 @@ Job_AbortAll(void)
continue;
}
-#ifdef REMOTE
-/*-
- *-----------------------------------------------------------------------
- * JobFlagForMigration --
- * Handle the eviction of a child. Called from RmtStatusChange.
- * Flags the child as remigratable and then suspends it.
- *
- * Input:
- * hostID ID of host we used, for matching children
- *
- * Results:
- * none.
- *
- * Side Effects:
- * The job descriptor is flagged for remigration.
- *
- *-----------------------------------------------------------------------
- */
-void
-JobFlagForMigration(int hostID)
-{
- Job *job; /* job descriptor for dead child */
- LstNode jnode; /* list element for finding job */
-
- if (DEBUG(JOB)) {
- (void)fprintf(stdout, "JobFlagForMigration(%d) called.\n", hostID);
- (void)fflush(stdout);
- }
- jnode = Lst_Find(jobs, (ClientData)&hostID, JobCmpRmtID);
-
- if (jnode == NILLNODE) {
- jnode = Lst_Find(stoppedJobs, (ClientData)hostID, JobCmpRmtID);
- if (jnode == NILLNODE) {
- if (DEBUG(JOB)) {
- Error("Evicting host(%d) not in table", hostID);
- }
- return;
- }
- }
- job = (Job *)Lst_Datum(jnode);
-
- if (DEBUG(JOB)) {
- (void)fprintf(stdout,
- "JobFlagForMigration(%d) found job '%s'.\n", hostID,
- job->node->name);
- (void)fflush(stdout);
- }
-
- KILL(job->pid, SIGSTOP);
-
- job->flags |= JOB_REMIGRATE;
-}
-
-#endif
/*-
*-----------------------------------------------------------------------
* JobRestartJobs --
* Tries to restart stopped jobs if there are slots available.
- * Note that this tries to restart them regardless of pending errors.
- * It's not good to leave stopped jobs lying around!
+ * Called in process context in response to a SIGCONT.
*
* Results:
* None.
*
* Side Effects:
- * Resumes(and possibly migrates) jobs.
+ * Resumes jobs.
*
*-----------------------------------------------------------------------
*/
static void
JobRestartJobs(void)
{
- sigset_t mask;
+ Job *job;
- JobSigLock(&mask);
- while (!Lst_IsEmpty(stoppedJobs)) {
- if (DEBUG(JOB)) {
- (void)fprintf(stdout, "Restarting a stopped job.\n");
- (void)fflush(stdout);
+ for (job = job_table; job < job_table_end; job++) {
+ if (job->job_state == JOB_ST_RUNNING &&
+ (make_suspended || job->job_suspended)) {
+ if (DEBUG(JOB)) {
+ (void)fprintf(debug_file, "Restarting stopped job pid %d.\n",
+ job->pid);
+ }
+ if (job->job_suspended) {
+ (void)printf("*** [%s] Continued\n", job->node->name);
+ (void)fflush(stdout);
+ }
+ job->job_suspended = 0;
+ if (KILLPG(job->pid, SIGCONT) != 0 && DEBUG(JOB)) {
+ fprintf(debug_file, "Failed to send SIGCONT to %d\n", job->pid);
+ }
}
- if (JobRestart((Job *)Lst_DeQueue(stoppedJobs)) != 0)
- break;
+ if (job->job_state == JOB_ST_FINISHED)
+ /* Job exit deferred after calling waitpid() in a signal handler */
+ JobFinish(job, job->exit_status);
}
- JobSigUnlock(&mask);
+ make_suspended = 0;
}
-#ifndef RMT_WILL_WATCH
static void
watchfd(Job *job)
{
- int i;
if (job->inPollfd != NULL)
Punt("Watching watched job");
- if (fds == NULL) {
- maxfds = JBSTART;
- fds = emalloc(sizeof(struct pollfd) * maxfds);
- jobfds = emalloc(sizeof(Job **) * maxfds);
-
- fds[0].fd = job_pipe[0];
- fds[0].events = POLLIN;
- jobfds[0] = &tokenWaitJob;
- tokenWaitJob.inPollfd = &fds[0];
- nfds++;
-
- fds[1].fd = exit_pipe[0];
- fds[1].events = POLLIN;
- jobfds[1] = &childExitJob;
- childExitJob.inPollfd = &fds[1];
- nfds++;
- } else if (nfds == maxfds) {
- maxfds *= JBFACTOR;
- fds = erealloc(fds, sizeof(struct pollfd) * maxfds);
- jobfds = erealloc(jobfds, sizeof(Job **) * maxfds);
- for (i = 0; i < nfds; i++)
- jobfds[i]->inPollfd = &fds[i];
- }
fds[nfds].fd = job->inPipe;
fds[nfds].events = POLLIN;
@@ -3519,7 +2723,6 @@ readyfd(Job *job)
Punt("Polling unwatched job");
return (job->inPollfd->revents & POLLIN) != 0;
}
-#endif
/*-
*-----------------------------------------------------------------------
@@ -3536,10 +2739,16 @@ readyfd(Job *job)
static void
JobTokenAdd(void)
{
+ char tok = JOB_TOKENS[aborting], tok1;
+
+ /* If we are depositing an error token flush everything else */
+ while (tok != '+' && read(tokenWaitJob.inPipe, &tok1, 1) == 1)
+ continue;
if (DEBUG(JOB))
- printf("deposit token\n");
- write(job_pipe[1], "+", 1);
+ fprintf(debug_file, "(%d) aborting %d, deposit token %c\n",
+ getpid(), aborting, JOB_TOKENS[aborting]);
+ write(tokenWaitJob.outPipe, &tok, 1);
}
/*-
@@ -3551,53 +2760,38 @@ JobTokenAdd(void)
*/
void
-Job_ServerStart(int maxproc)
+Job_ServerStart(int max_tokens, int jp_0, int jp_1)
{
- int i, flags;
+ int i;
char jobarg[64];
- if (pipe(job_pipe) < 0)
- Fatal("error in pipe: %s", strerror(errno));
-
- /*
- * We mark the input side of the pipe non-blocking; we poll(2) the
- * pipe when we're waiting for a job token, but we might lose the
- * race for the token when a new one becomes available, so the read
- * from the pipe should not block.
- */
- flags = fcntl(job_pipe[0], F_GETFL, 0);
- flags |= O_NONBLOCK;
- fcntl(job_pipe[0], F_SETFL, flags);
+ if (jp_0 >= 0 && jp_1 >= 0) {
+ /* Pipe passed in from parent */
+ tokenWaitJob.inPipe = jp_0;
+ tokenWaitJob.outPipe = jp_1;
+ return;
+ }
- /*
- * Mark job pipes as close-on-exec.
- * Note that we will clear this when executing submakes.
- */
- fcntl(job_pipe[0], F_SETFD, 1);
- fcntl(job_pipe[1], F_SETFD, 1);
+ JobCreatePipe(&tokenWaitJob, 15);
- snprintf(jobarg, sizeof(jobarg), "%d,%d", job_pipe[0], job_pipe[1]);
+ snprintf(jobarg, sizeof(jobarg), "%d,%d",
+ tokenWaitJob.inPipe, tokenWaitJob.outPipe);
Var_Append(MAKEFLAGS, "-J", VAR_GLOBAL);
Var_Append(MAKEFLAGS, jobarg, VAR_GLOBAL);
-
+
/*
- * Preload job_pipe with one token per job, save the one
+ * Preload the job pipe with one token per job, save the one
* "extra" token for the primary job.
*
- * XXX should clip maxJobs against PIPE_BUF -- if maxJobs is
+ * XXX should clip maxJobs against PIPE_BUF -- if max_tokens is
* larger than the write buffer size of the pipe, we will
* deadlock here.
*/
- for (i=1; i < maxproc; i++)
+ for (i = 1; i < max_tokens; i++)
JobTokenAdd();
}
-/*
- * this tracks the number of tokens currently "out" to build jobs.
- */
-int jobTokensRunning = 0;
-int jobTokensFree = 0;
/*-
*-----------------------------------------------------------------------
* Job_TokenReturn --
@@ -3612,8 +2806,8 @@ Job_TokenReturn(void)
jobTokensRunning--;
if (jobTokensRunning < 0)
Punt("token botch");
- if (jobTokensRunning)
- jobTokensFree++;
+ if (jobTokensRunning || JOB_TOKENS[aborting] != '+')
+ JobTokenAdd();
}
/*-
@@ -3636,62 +2830,51 @@ Job_TokenReturn(void)
Boolean
Job_TokenWithdraw(void)
{
- char tok;
+ char tok, tok1;
int count;
- wantToken = FALSE;
+ wantToken = 0;
+ if (DEBUG(JOB))
+ fprintf(debug_file, "Job_TokenWithdraw(%d): aborting %d, running %d\n",
+ getpid(), aborting, jobTokensRunning);
- if (aborting)
- return FALSE;
+ if (aborting || (jobTokensRunning >= maxJobs))
+ return FALSE;
- if (jobTokensRunning == 0) {
- if (DEBUG(JOB))
- printf("first one's free\n");
- jobTokensRunning++;
- return TRUE;
- }
- if (jobTokensFree > 0) {
- jobTokensFree--;
- jobTokensRunning++;
- return TRUE;
- }
- count = read(job_pipe[0], &tok, 1);
+ count = read(tokenWaitJob.inPipe, &tok, 1);
if (count == 0)
Fatal("eof on job pipe!");
- else if (count < 0) {
+ if (count < 0 && jobTokensRunning != 0) {
if (errno != EAGAIN) {
Fatal("job pipe read: %s", strerror(errno));
}
if (DEBUG(JOB))
- printf("blocked for token\n");
- wantToken = TRUE;
+ fprintf(debug_file, "(%d) blocked for token\n", getpid());
+ wantToken = 1;
return FALSE;
}
+
+ if (count == 1 && tok != '+') {
+ /* make being abvorted - remove any other job tokens */
+ if (DEBUG(JOB))
+ fprintf(debug_file, "(%d) aborted by token %c\n", getpid(), tok);
+ while (read(tokenWaitJob.inPipe, &tok1, 1) == 1)
+ continue;
+ /* And put the stopper back */
+ write(tokenWaitJob.outPipe, &tok, 1);
+ Fatal("A failure has been detected in another branch of the parallel make");
+ }
+
+ if (count == 1 && jobTokensRunning == 0)
+ /* We didn't want the token really */
+ write(tokenWaitJob.outPipe, &tok, 1);
+
jobTokensRunning++;
if (DEBUG(JOB))
- printf("withdrew token\n");
+ fprintf(debug_file, "(%d) withdrew token\n", getpid());
return TRUE;
}
-/*-
- *-----------------------------------------------------------------------
- * Job_TokenFlush --
- * Return free tokens to the pool.
- *
- *-----------------------------------------------------------------------
- */
-
-void
-Job_TokenFlush(void)
-{
- if (compatMake) return;
-
- while (jobTokensFree > 0) {
- JobTokenAdd();
- jobTokensFree--;
- }
-}
-
#ifdef USE_SELECT
int
emul_poll(struct pollfd *fd, int nfd, int timeout)
diff --git a/devel/bmake/files/job.h b/devel/bmake/files/job.h
index 5b11a1580c6..3083c57c999 100644
--- a/devel/bmake/files/job.h
+++ b/devel/bmake/files/job.h
@@ -1,4 +1,4 @@
-/* $NetBSD: job.h,v 1.4 2007/09/06 19:23:26 joerg Exp $ */
+/* $NetBSD: job.h,v 1.5 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -76,7 +76,6 @@
/*-
* job.h --
* Definitions pertaining to the running of jobs in parallel mode.
- * Exported from job.c for the use of remote-execution modules.
*/
#ifndef _JOB_H_
#define _JOB_H_
@@ -123,30 +122,18 @@ emul_poll(struct pollfd *fd, int nfd, int timeout);
* commands.
* 4) An FILE* for writing out the commands. This is only
* used before the job is actually started.
- * 5) A union of things used for handling the shell's output. Different
- * parts of the union are used based on the value of the usePipes
- * flag. If it is true, the output is being caught via a pipe and
+ * 5) The output is being caught via a pipe and
* the descriptors of our pipe, an array in which output is line
* buffered and the current position in that buffer are all
- * maintained for each job. If, on the other hand, usePipes is false,
- * the output is routed to a temporary file and all that is kept
- * is the name of the file and the descriptor open to the file.
- * 6) An identifier provided by and for the exclusive use of the
- * Rmt module.
- * 7) A word of flags which determine how the module handles errors,
+ * maintained for each job.
+ * 6) A word of flags which determine how the module handles errors,
* echoing, etc. for the job
*
- * The job "table" is kept as a linked Lst in 'jobs', with the number of
- * active jobs maintained in the 'nJobs' variable. At no time will this
- * exceed the value of 'maxJobs', initialized by the Job_Init function.
- *
* When a job is finished, the Make_Update function is called on each of the
* parents of the node which was just remade. This takes care of the upward
* traversal of the dependency graph.
*/
-#ifndef RMT_WILL_WATCH
struct pollfd;
-#endif
#define JOB_BUFSIZE 1024
typedef struct Job {
@@ -156,7 +143,13 @@ typedef struct Job {
* saved when the job has been run */
FILE *cmdFILE; /* When creating the shell script, this is
* where the commands go */
- int rmtID; /* ID returned from Rmt module */
+ int exit_status; /* from wait4() in signal handler */
+ char job_state; /* status of the job entry */
+#define JOB_ST_FREE 0 /* Job is available */
+#define JOB_ST_SETUP 1 /* Job is allocated but otherwise invalid */
+#define JOB_ST_RUNNING 3 /* Job is running, pid valid */
+#define JOB_ST_FINISHED 4 /* Job is done (ie after SIGCHILD) */
+ char job_suspended;
short flags; /* Flags to control treatment of job */
#define JOB_IGNERR 0x001 /* Ignore non-zero exits */
#define JOB_SILENT 0x002 /* no output */
@@ -164,53 +157,18 @@ typedef struct Job {
* if we can't export it and maxLocal is 0 */
#define JOB_IGNDOTS 0x008 /* Ignore "..." lines when processing
* commands */
-#define JOB_REMOTE 0x010 /* Job is running remotely */
-#define JOB_FIRST 0x020 /* Job is first job for the node */
-#define JOB_REMIGRATE 0x040 /* Job needs to be remigrated */
-#define JOB_RESTART 0x080 /* Job needs to be completely restarted */
-#define JOB_RESUME 0x100 /* Job needs to be resumed b/c it stopped,
- * for some reason */
-#define JOB_CONTINUING 0x200 /* We are in the process of resuming this job.
- * Used to avoid infinite recursion between
- * JobFinish and JobRestart */
#define JOB_TRACED 0x400 /* we've sent 'set -x' */
- union {
- struct {
- int op_inPipe; /* Input side of pipe associated
- * with job's output channel */
-#ifndef RMT_WILL_WATCH
- struct pollfd *op_inPollfd; /* pollfd associated with inPipe */
-#endif
- int op_outPipe; /* Output side of pipe associated with
- * job's output channel */
- char op_outBuf[JOB_BUFSIZE + 1];
- /* Buffer for storing the output of the
- * job, line by line */
- int op_curPos; /* Current position in op_outBuf */
- } o_pipe; /* data used when catching the output via
- * a pipe */
- struct {
- char of_outFile[sizeof(TMPPAT)+2];
- /* Name of file to which shell output
- * was rerouted */
- int of_outFd; /* Stream open to the output
- * file. Used to funnel all
- * from a single job to one file
- * while still allowing
- * multiple shell invocations */
- } o_file; /* Data used when catching the output in
- * a temporary file */
- } output; /* Data for tracking a shell's output */
+ int jobPipe[2]; /* Pipe for readind output from job */
+ struct pollfd *inPollfd; /* pollfd associated with inPipe */
+ char outBuf[JOB_BUFSIZE + 1];
+ /* Buffer for storing the output of the
+ * job, line by line */
+ int curPos; /* Current position in op_outBuf */
} Job;
-#define outPipe output.o_pipe.op_outPipe
-#define inPipe output.o_pipe.op_inPipe
-#define inPollfd output.o_pipe.op_inPollfd
-#define outBuf output.o_pipe.op_outBuf
-#define curPos output.o_pipe.op_curPos
-#define outFile output.o_file.of_outFile
-#define outFd output.o_file.of_outFd
+#define inPipe jobPipe[0]
+#define outPipe jobPipe[1]
/*-
@@ -244,7 +202,6 @@ typedef struct Job {
* echo "%s\n" as a template.
*/
typedef struct Shell {
- const char *path;
const char *name; /* the name of the shell. For Bourne and C
* shells, this is used only to find the
* shell description when used as the single
@@ -263,6 +220,9 @@ typedef struct Shell {
const char *errCheck; /* string to turn error checking on */
const char *ignErr; /* string to turn off error checking */
const char *errOut; /* string to use for testing exit code */
+ const char *newline; /* string literal that results in a newline
+ * character when it appears outside of any
+ * 'quote' or "quote" characters */
char commentChar; /* character used by shell for comment lines */
/*
@@ -275,33 +235,18 @@ typedef struct Shell {
extern const char *shellPath;
extern const char *shellName;
-extern int job_pipe[2]; /* token pipe for jobs. */
extern int jobTokensRunning; /* tokens currently "out" */
-extern int jobTokensFree; /* tokens free but not yet released to pipe */
-
-#ifdef REMOTE
-extern char *targFmt; /* Format string for banner that separates
- * output from multiple jobs. Contains a
- * single %s where the name of the node being
- * made should be put. */
-extern GNode *lastNode; /* Last node for which a banner was printed.
- * If Rmt module finds it necessary to print
- * a banner, it should set this to the node
- * for which the banner was printed */
-extern int nJobs; /* Number of jobs running (local and remote) */
-extern int nLocal; /* Number of jobs running locally */
-extern Lst jobs; /* List of active job descriptors */
-extern Lst stoppedJobs; /* List of jobs that are stopped or didn't
- * quite get started */
-#endif
+extern int maxJobs; /* Max jobs we can run */
void Shell_Init(void);
+const char *Shell_GetNewline(void);
void Job_Touch(GNode *, Boolean);
Boolean Job_CheckCommands(GNode *, void (*abortProc )(const char *, ...));
-void Job_CatchChildren(Boolean);
+#define CATCH_BLOCK 1
+void Job_CatchChildren(void);
void Job_CatchOutput(void);
void Job_Make(GNode *);
-void Job_Init(int, int);
+void Job_Init(void);
Boolean Job_Full(void);
Boolean Job_Empty(void);
ReturnStatus Job_ParseShell(char *);
@@ -311,8 +256,8 @@ void Job_Wait(void);
void Job_AbortAll(void);
void JobFlagForMigration(int);
void Job_TokenReturn(void);
-void Job_TokenFlush(void);
Boolean Job_TokenWithdraw(void);
-void Job_ServerStart(int);
+void Job_ServerStart(int, int, int);
+void Job_SetPrefix(void);
#endif /* _JOB_H_ */
diff --git a/devel/bmake/files/lst.h b/devel/bmake/files/lst.h
index 5205294a542..b3efa00e602 100644
--- a/devel/bmake/files/lst.h
+++ b/devel/bmake/files/lst.h
@@ -1,4 +1,4 @@
-/* $NetBSD: lst.h,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $ */
+/* $NetBSD: lst.h,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
diff --git a/devel/bmake/files/lst.lib/Makefile b/devel/bmake/files/lst.lib/Makefile
index 1f49ba4fd53..3674011a40d 100644
--- a/devel/bmake/files/lst.lib/Makefile
+++ b/devel/bmake/files/lst.lib/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $
+# $NetBSD: Makefile,v 1.2 2008/03/09 19:54:29 joerg Exp $
OBJ=lstAppend.o lstDupl.o lstInit.o lstOpen.o lstAtEnd.o lstEnQueue.o \
lstInsert.o lstAtFront.o lstIsAtEnd.o lstClose.o lstFind.o lstIsEmpty.o \
diff --git a/devel/bmake/files/lst.lib/lstAppend.c b/devel/bmake/files/lst.lib/lstAppend.c
index 97b1bbae1b0..6249ce751ae 100644
--- a/devel/bmake/files/lst.lib/lstAppend.c
+++ b/devel/bmake/files/lst.lib/lstAppend.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstAppend.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstAppend.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstAppend.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstAppend.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstAppend.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstAppend.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstAppend.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstAtEnd.c b/devel/bmake/files/lst.lib/lstAtEnd.c
index cbc926fb01a..a0b0eed50bb 100644
--- a/devel/bmake/files/lst.lib/lstAtEnd.c
+++ b/devel/bmake/files/lst.lib/lstAtEnd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstAtEnd.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstAtEnd.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstAtEnd.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstAtEnd.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstAtEnd.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstAtEnd.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstAtEnd.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstAtFront.c b/devel/bmake/files/lst.lib/lstAtFront.c
index 3bf37a9c07f..4b3b2198d8c 100644
--- a/devel/bmake/files/lst.lib/lstAtFront.c
+++ b/devel/bmake/files/lst.lib/lstAtFront.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstAtFront.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstAtFront.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstAtFront.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstAtFront.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstAtFront.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstAtFront.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstAtFront.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstClose.c b/devel/bmake/files/lst.lib/lstClose.c
index 42f852612b5..8d8446f10df 100644
--- a/devel/bmake/files/lst.lib/lstClose.c
+++ b/devel/bmake/files/lst.lib/lstClose.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstClose.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstClose.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstClose.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstClose.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstClose.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstClose.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstClose.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstConcat.c b/devel/bmake/files/lst.lib/lstConcat.c
index 6c15e4704c5..a72f1463e78 100644
--- a/devel/bmake/files/lst.lib/lstConcat.c
+++ b/devel/bmake/files/lst.lib/lstConcat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstConcat.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstConcat.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstConcat.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstConcat.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstConcat.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstConcat.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstConcat.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstDatum.c b/devel/bmake/files/lst.lib/lstDatum.c
index 06d841a11ca..25b3b54384a 100644
--- a/devel/bmake/files/lst.lib/lstDatum.c
+++ b/devel/bmake/files/lst.lib/lstDatum.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstDatum.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstDatum.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstDatum.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstDatum.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstDatum.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstDatum.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstDatum.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstDeQueue.c b/devel/bmake/files/lst.lib/lstDeQueue.c
index 92bb4149cbe..a64e22ed2f5 100644
--- a/devel/bmake/files/lst.lib/lstDeQueue.c
+++ b/devel/bmake/files/lst.lib/lstDeQueue.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstDeQueue.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstDeQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstDeQueue.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstDeQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstDeQueue.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstDeQueue.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstDeQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstDestroy.c b/devel/bmake/files/lst.lib/lstDestroy.c
index 67d6563e06f..424bbda5b7f 100644
--- a/devel/bmake/files/lst.lib/lstDestroy.c
+++ b/devel/bmake/files/lst.lib/lstDestroy.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstDestroy.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstDestroy.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstDestroy.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstDestroy.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstDestroy.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstDestroy.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstDestroy.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstDupl.c b/devel/bmake/files/lst.lib/lstDupl.c
index a4a65f34924..d47e408e7ed 100644
--- a/devel/bmake/files/lst.lib/lstDupl.c
+++ b/devel/bmake/files/lst.lib/lstDupl.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstDupl.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstDupl.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstDupl.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstDupl.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstDupl.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstDupl.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstDupl.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstEnQueue.c b/devel/bmake/files/lst.lib/lstEnQueue.c
index 6832b79ac20..4b644fac0c7 100644
--- a/devel/bmake/files/lst.lib/lstEnQueue.c
+++ b/devel/bmake/files/lst.lib/lstEnQueue.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstEnQueue.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstEnQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstEnQueue.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstEnQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstEnQueue.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstEnQueue.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstEnQueue.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstFind.c b/devel/bmake/files/lst.lib/lstFind.c
index e45aeb5f7e2..b92f98d258c 100644
--- a/devel/bmake/files/lst.lib/lstFind.c
+++ b/devel/bmake/files/lst.lib/lstFind.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstFind.c,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $ */
+/* $NetBSD: lstFind.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstFind.c,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $";
+static char rcsid[] = "$NetBSD: lstFind.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstFind.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstFind.c,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $");
+__RCSID("$NetBSD: lstFind.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstFindFrom.c b/devel/bmake/files/lst.lib/lstFindFrom.c
index 271f310ca67..70b8ff0df51 100644
--- a/devel/bmake/files/lst.lib/lstFindFrom.c
+++ b/devel/bmake/files/lst.lib/lstFindFrom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstFindFrom.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstFindFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstFindFrom.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstFindFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstFindFrom.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstFindFrom.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstFindFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstFirst.c b/devel/bmake/files/lst.lib/lstFirst.c
index 4539f8b22f8..f40c80eeeaa 100644
--- a/devel/bmake/files/lst.lib/lstFirst.c
+++ b/devel/bmake/files/lst.lib/lstFirst.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstFirst.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstFirst.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstFirst.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstFirst.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstFirst.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstFirst.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstFirst.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstForEach.c b/devel/bmake/files/lst.lib/lstForEach.c
index cca3dd80f5d..571191cedec 100644
--- a/devel/bmake/files/lst.lib/lstForEach.c
+++ b/devel/bmake/files/lst.lib/lstForEach.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstForEach.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstForEach.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstForEach.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstForEach.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstForEach.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstForEach.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstForEach.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstForEachFrom.c b/devel/bmake/files/lst.lib/lstForEachFrom.c
index c65a60043a3..b0f3b39d423 100644
--- a/devel/bmake/files/lst.lib/lstForEachFrom.c
+++ b/devel/bmake/files/lst.lib/lstForEachFrom.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstForEachFrom.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstForEachFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstForEachFrom.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstForEachFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstForEachFrom.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstForEachFrom.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstForEachFrom.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstInit.c b/devel/bmake/files/lst.lib/lstInit.c
index a82d127cca8..929ffec2da3 100644
--- a/devel/bmake/files/lst.lib/lstInit.c
+++ b/devel/bmake/files/lst.lib/lstInit.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstInit.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstInit.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstInit.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstInit.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstInit.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstInit.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstInit.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstInsert.c b/devel/bmake/files/lst.lib/lstInsert.c
index c60022efdfa..f038baf4236 100644
--- a/devel/bmake/files/lst.lib/lstInsert.c
+++ b/devel/bmake/files/lst.lib/lstInsert.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstInsert.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstInsert.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstInsert.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstInsert.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstInsert.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstInsert.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstInsert.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstInt.h b/devel/bmake/files/lst.lib/lstInt.h
index f194ff54c34..8969ea30e9d 100644
--- a/devel/bmake/files/lst.lib/lstInt.h
+++ b/devel/bmake/files/lst.lib/lstInt.h
@@ -1,4 +1,4 @@
-/* $NetBSD: lstInt.h,v 1.3 2007/07/31 13:28:57 joerg Exp $ */
+/* $NetBSD: lstInt.h,v 1.4 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -47,7 +47,7 @@
typedef struct ListNode {
struct ListNode *prevPtr; /* previous element in list */
struct ListNode *nextPtr; /* next in list */
- unsigned int useCount:8, /* Count of functions using the node.
+ unsigned int useCount:8, /* Count of functions using the node.
* node may not be deleted until count
* goes to 0 */
flags:8; /* Node status flags */
@@ -64,7 +64,7 @@ typedef enum {
Head, Middle, Tail, Unknown
} Where;
-typedef struct {
+typedef struct List {
ListNode firstPtr; /* first node in list */
ListNode lastPtr; /* last node in list */
Boolean isCirc; /* true if the list should be considered
@@ -86,24 +86,24 @@ typedef struct {
* PAlloc (var, ptype) --
* Allocate a pointer-typedef structure 'ptype' into the variable 'var'
*/
-#define PAlloc(var,ptype) var = (ptype) emalloc(sizeof (*var))
+#define PAlloc(var,ptype) var = (ptype) emalloc(sizeof *(var))
/*
* LstValid (l) --
* Return TRUE if the list l is valid
*/
-#define LstValid(l) (((Lst)l == NILLST) ? FALSE : TRUE)
+#define LstValid(l) ((Lst)(l) != NILLST)
/*
* LstNodeValid (ln, l) --
* Return TRUE if the LstNode ln is valid with respect to l
*/
-#define LstNodeValid(ln, l) ((((LstNode)ln) == NILLNODE) ? FALSE : TRUE)
+#define LstNodeValid(ln, l) ((ln) != NILLNODE)
/*
* LstIsEmpty (l) --
* TRUE if the list l is empty.
*/
-#define LstIsEmpty(l) (((List)l)->firstPtr == NilListNode)
+#define LstIsEmpty(l) (((List)(l))->firstPtr == NilListNode)
#endif /* _LSTINT_H_ */
diff --git a/devel/bmake/files/lst.lib/lstIsAtEnd.c b/devel/bmake/files/lst.lib/lstIsAtEnd.c
index fb09223c3ce..08e4d32f823 100644
--- a/devel/bmake/files/lst.lib/lstIsAtEnd.c
+++ b/devel/bmake/files/lst.lib/lstIsAtEnd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstIsAtEnd.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstIsAtEnd.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstIsAtEnd.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstIsAtEnd.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstIsAtEnd.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstIsAtEnd.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstIsAtEnd.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstIsEmpty.c b/devel/bmake/files/lst.lib/lstIsEmpty.c
index 87aad7ae4e5..a79c34fb80e 100644
--- a/devel/bmake/files/lst.lib/lstIsEmpty.c
+++ b/devel/bmake/files/lst.lib/lstIsEmpty.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstIsEmpty.c,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $ */
+/* $NetBSD: lstIsEmpty.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstIsEmpty.c,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $";
+static char rcsid[] = "$NetBSD: lstIsEmpty.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstIsEmpty.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstIsEmpty.c,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $");
+__RCSID("$NetBSD: lstIsEmpty.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstLast.c b/devel/bmake/files/lst.lib/lstLast.c
index 47cc372cebb..f920ac9f301 100644
--- a/devel/bmake/files/lst.lib/lstLast.c
+++ b/devel/bmake/files/lst.lib/lstLast.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstLast.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstLast.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstLast.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstLast.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstLast.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstLast.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstLast.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstMember.c b/devel/bmake/files/lst.lib/lstMember.c
index a023ac97248..f79d03ab3a8 100644
--- a/devel/bmake/files/lst.lib/lstMember.c
+++ b/devel/bmake/files/lst.lib/lstMember.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstMember.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstMember.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstMember.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstMember.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstMember.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstMember.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstMember.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstNext.c b/devel/bmake/files/lst.lib/lstNext.c
index f28e467c0c1..2733d78bc56 100644
--- a/devel/bmake/files/lst.lib/lstNext.c
+++ b/devel/bmake/files/lst.lib/lstNext.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstNext.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstNext.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstNext.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstNext.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstNext.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstNext.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstNext.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstOpen.c b/devel/bmake/files/lst.lib/lstOpen.c
index 9208b35ac3b..901bbc69120 100644
--- a/devel/bmake/files/lst.lib/lstOpen.c
+++ b/devel/bmake/files/lst.lib/lstOpen.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstOpen.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstOpen.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstOpen.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstOpen.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstOpen.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstOpen.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstOpen.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstRemove.c b/devel/bmake/files/lst.lib/lstRemove.c
index 37c949a627a..fd1f712191b 100644
--- a/devel/bmake/files/lst.lib/lstRemove.c
+++ b/devel/bmake/files/lst.lib/lstRemove.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstRemove.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstRemove.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstRemove.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstRemove.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstRemove.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstRemove.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstRemove.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstReplace.c b/devel/bmake/files/lst.lib/lstReplace.c
index c7aa48aad5c..9dd1f97de77 100644
--- a/devel/bmake/files/lst.lib/lstReplace.c
+++ b/devel/bmake/files/lst.lib/lstReplace.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstReplace.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstReplace.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstReplace.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstReplace.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstReplace.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstReplace.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstReplace.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/lstSucc.c b/devel/bmake/files/lst.lib/lstSucc.c
index 497bac25967..c39df6a6830 100644
--- a/devel/bmake/files/lst.lib/lstSucc.c
+++ b/devel/bmake/files/lst.lib/lstSucc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: lstSucc.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $ */
+/* $NetBSD: lstSucc.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -33,14 +33,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: lstSucc.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $";
+static char rcsid[] = "$NetBSD: lstSucc.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)lstSucc.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: lstSucc.c,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $");
+__RCSID("$NetBSD: lstSucc.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/lst.lib/makefile.boot.in b/devel/bmake/files/lst.lib/makefile.boot.in
index efb3790a700..1fe24a89ce0 100644
--- a/devel/bmake/files/lst.lib/makefile.boot.in
+++ b/devel/bmake/files/lst.lib/makefile.boot.in
@@ -1,5 +1,5 @@
# RCSid:
-# $Id: makefile.boot.in,v 1.3 2007/05/29 19:00:42 schmonz Exp $
+# $Id: makefile.boot.in,v 1.4 2008/03/09 19:54:29 joerg Exp $
srcdir=@srcdir@
VPATH=.:$(srcdir)
@@ -8,7 +8,7 @@ OBJ=lstAppend.o lstDupl.o lstInit.o lstOpen.o lstAtEnd.o lstEnQueue.o \
lstInsert.o lstAtFront.o lstIsAtEnd.o lstClose.o lstFind.o lstIsEmpty.o \
lstRemove.o lstConcat.o lstFindFrom.o lstLast.o lstReplace.o lstFirst.o \
lstDatum.o lstForEach.o lstMember.o lstSucc.o lstDeQueue.o \
- lstForEachFrom.o lstDestroy.o lstNext.o
+ lstForEachFrom.o lstDestroy.o lstNext.o lstPrev.o
CFLAGS=@CFLAGS@ -I..
all: ${OBJ}
diff --git a/devel/bmake/files/machine.sh b/devel/bmake/files/machine.sh
index 76698e34bd6..501a0653747 100755
--- a/devel/bmake/files/machine.sh
+++ b/devel/bmake/files/machine.sh
@@ -2,7 +2,7 @@
# derrived from /etc/rc_d/os.sh
# RCSid:
-# $Id: machine.sh,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $
+# $Id: machine.sh,v 1.2 2008/03/09 19:54:29 joerg Exp $
#
# @(#) Copyright (c) 1994-2002 Simon J. Gerraty
#
diff --git a/devel/bmake/files/main.c b/devel/bmake/files/main.c
index 1cb2d1663a7..aa58e8f266f 100644
--- a/devel/bmake/files/main.c
+++ b/devel/bmake/files/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.3 2007/09/06 19:23:26 joerg Exp $ */
+/* $NetBSD: main.c,v 1.4 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.3 2007/09/06 19:23:26 joerg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.4 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
@@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\n\
#if 0
static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: main.c,v 1.3 2007/09/06 19:23:26 joerg Exp $");
+__RCSID("$NetBSD: main.c,v 1.4 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -156,7 +156,7 @@ static Lst makefiles; /* ordered list of makefiles to read */
static Boolean printVars; /* print value of one or more vars */
static Lst variables; /* list of variables to print */
int maxJobs; /* -j argument */
-static int maxLocal; /* -L argument */
+static int maxJobTokens; /* -j argument */
Boolean compatMake; /* -B argument */
int debug; /* -d argument */
Boolean noExecute; /* -n flag */
@@ -164,14 +164,15 @@ Boolean noRecursiveExecute; /* -N flag */
Boolean keepgoing; /* -k flag */
Boolean queryFlag; /* -q flag */
Boolean touchFlag; /* -t flag */
-Boolean usePipes; /* !-P flag */
Boolean ignoreErrors; /* -i flag */
Boolean beSilent; /* -s flag */
Boolean oldVars; /* variable substitution style */
Boolean checkEnvFirst; /* -e flag */
Boolean parseWarnFatal; /* -W flag */
Boolean jobServer; /* -J flag */
+static int jp_0 = -1, jp_1 = -1; /* ends of parent job pipe */
Boolean varNoExportEnv; /* -X flag */
+Boolean doing_depend; /* Set while reading .depend */
static Boolean jobsRunning; /* TRUE if the jobs might be running */
static const char * tracefile;
#ifndef NO_CHECK_MAKE_CHDIR
@@ -198,6 +199,116 @@ Boolean forceJobs = FALSE;
extern Lst parseIncPath;
+static void
+parse_debug_options(const char *argvalue)
+{
+ const char *modules;
+ const char *mode;
+ char *fname;
+ int len;
+
+ for (modules = argvalue; *modules; ++modules) {
+ switch (*modules) {
+ case 'A':
+ debug = ~0;
+ break;
+ case 'a':
+ debug |= DEBUG_ARCH;
+ break;
+ case 'c':
+ debug |= DEBUG_COND;
+ break;
+ case 'd':
+ debug |= DEBUG_DIR;
+ break;
+ case 'e':
+ debug |= DEBUG_ERROR;
+ break;
+ case 'f':
+ debug |= DEBUG_FOR;
+ break;
+ case 'g':
+ if (modules[1] == '1') {
+ debug |= DEBUG_GRAPH1;
+ ++modules;
+ }
+ else if (modules[1] == '2') {
+ debug |= DEBUG_GRAPH2;
+ ++modules;
+ }
+ else if (modules[1] == '3') {
+ debug |= DEBUG_GRAPH3;
+ ++modules;
+ }
+ break;
+ case 'j':
+ debug |= DEBUG_JOB;
+ break;
+ case 'l':
+ debug |= DEBUG_LOUD;
+ break;
+ case 'm':
+ debug |= DEBUG_MAKE;
+ break;
+ case 'n':
+ debug |= DEBUG_SCRIPT;
+ break;
+ case 'p':
+ debug |= DEBUG_PARSE;
+ break;
+ case 's':
+ debug |= DEBUG_SUFF;
+ break;
+ case 't':
+ debug |= DEBUG_TARG;
+ break;
+ case 'v':
+ debug |= DEBUG_VAR;
+ break;
+ case 'x':
+ debug |= DEBUG_SHELL;
+ break;
+ case 'F':
+ if (debug_file != stdout && debug_file != stderr)
+ fclose(debug_file);
+ if (*++modules == '+')
+ mode = "a";
+ else {
+ if (!strcmp(modules, "stdout")) {
+ debug_file = stdout;
+ return;
+ }
+ if (!strcmp(modules, "stderr")) {
+ debug_file = stderr;
+ return;
+ }
+ mode = "w";
+ }
+ len = strlen(modules);
+ fname = malloc(len + 20);
+ memcpy(fname, modules, len + 1);
+ /* Let the filename be modified by the pid */
+ if (strcmp(fname + len - 3, ".%d") == 0)
+ snprintf(fname + len - 2, 20, "%d", getpid());
+ debug_file = fopen(fname, mode);
+ if (!debug_file) {
+ fprintf(stderr, "Cannot open debug file %s\n",
+ fname);
+ usage();
+ }
+ free(fname);
+ /* Have this non-buffered */
+ setbuf(debug_file, NULL);
+ return;
+ default:
+ (void)fprintf(stderr,
+ "%s: illegal argument to d option -- %c\n",
+ progname, *modules);
+ usage();
+ }
+ }
+}
+
/*-
* MainParseArgs --
* Parse a given argument vector. Called from main() and from
@@ -216,7 +327,7 @@ static void
MainParseArgs(int argc, char **argv)
{
char *p;
- int c;
+ int c = '?';
int arginc;
char *argvalue;
const char *getopt_def;
@@ -224,13 +335,7 @@ MainParseArgs(int argc, char **argv)
Boolean inOption, dashDash = FALSE;
char found_path[MAXPATHLEN + 1]; /* for searching for sys.mk */
-#ifdef REMOTE
-# define OPTFLAGS "BD:I:J:L:NPST:V:WXd:ef:ij:km:nqrst"
-#else
-# define OPTFLAGS "BD:I:J:NPST:V:WXd:ef:ij:km:nqrst"
-#endif
-#undef optarg
-#define optarg argvalue
+#define OPTFLAGS "BD:I:J:NST:V:WXd:ef:ij:km:nqrst"
/* Can't actually use getopt(3) because rescanning is not portable */
getopt_def = OPTFLAGS;
@@ -264,13 +369,8 @@ rearg:
arginc = 1;
argvalue = optscan;
if(*argvalue == '\0') {
- if (argc < 3) {
- (void)fprintf(stderr,
- "%s: option requires "
- "an argument -- %c\n",
- progname, c);
- usage();
- }
+ if (argc < 3)
+ goto noarg;
argvalue = argv[2];
arginc = 2;
}
@@ -287,74 +387,63 @@ rearg:
Var_Append(MAKEFLAGS, "-B", VAR_GLOBAL);
break;
case 'D':
- Var_Set(optarg, "1", VAR_GLOBAL, 0);
+ if (argvalue == NULL) goto noarg;
+ Var_Set(argvalue, "1", VAR_GLOBAL, 0);
Var_Append(MAKEFLAGS, "-D", VAR_GLOBAL);
- Var_Append(MAKEFLAGS, optarg, VAR_GLOBAL);
+ Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL);
break;
case 'I':
- Parse_AddIncludeDir(optarg);
+ if (argvalue == NULL) goto noarg;
+ Parse_AddIncludeDir(argvalue);
Var_Append(MAKEFLAGS, "-I", VAR_GLOBAL);
- Var_Append(MAKEFLAGS, optarg, VAR_GLOBAL);
+ Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL);
break;
case 'J':
- if (sscanf(optarg, "%d,%d", &job_pipe[0], &job_pipe[1]) != 2) {
- /* backslash to avoid trigraph ??) */
+ if (argvalue == NULL) goto noarg;
+ if (sscanf(argvalue, "%d,%d", &jp_0, &jp_1) != 2) {
(void)fprintf(stderr,
- "%s: internal error -- J option malformed (%s?\?)\n",
- progname, optarg);
+ "%s: internal error -- J option malformed (%s)\n",
+ progname, argvalue);
usage();
}
- if ((fcntl(job_pipe[0], F_GETFD, 0) < 0) ||
- (fcntl(job_pipe[1], F_GETFD, 0) < 0)) {
+ if ((fcntl(jp_0, F_GETFD, 0) < 0) ||
+ (fcntl(jp_1, F_GETFD, 0) < 0)) {
#if 0
(void)fprintf(stderr,
- "%s: warning -- J descriptors were closed!\n",
+ "%s: ###### warning -- J descriptors were closed!\n",
progname);
+ exit(2);
#endif
- job_pipe[0] = -1;
- job_pipe[1] = -1;
+ jp_0 = -1;
+ jp_1 = -1;
compatMake = TRUE;
} else {
Var_Append(MAKEFLAGS, "-J", VAR_GLOBAL);
- Var_Append(MAKEFLAGS, optarg, VAR_GLOBAL);
+ Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL);
jobServer = TRUE;
}
break;
-#ifdef REMOTE
- case 'L':
- maxLocal = strtol(optarg, &p, 0);
- if (*p != '\0' || maxLocal < 1) {
- (void)fprintf(stderr, "%s: illegal argument to -L -- must be positive integer!\n",
- progname);
- exit(1);
- }
- Var_Append(MAKEFLAGS, "-L", VAR_GLOBAL);
- Var_Append(MAKEFLAGS, optarg, VAR_GLOBAL);
- break;
-#endif
case 'N':
noExecute = TRUE;
noRecursiveExecute = TRUE;
Var_Append(MAKEFLAGS, "-N", VAR_GLOBAL);
break;
- case 'P':
- usePipes = FALSE;
- Var_Append(MAKEFLAGS, "-P", VAR_GLOBAL);
- break;
case 'S':
keepgoing = FALSE;
Var_Append(MAKEFLAGS, "-S", VAR_GLOBAL);
break;
case 'T':
- tracefile = estrdup(optarg);
+ if (argvalue == NULL) goto noarg;
+ tracefile = estrdup(argvalue);
Var_Append(MAKEFLAGS, "-T", VAR_GLOBAL);
- Var_Append(MAKEFLAGS, optarg, VAR_GLOBAL);
+ Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL);
break;
case 'V':
+ if (argvalue == NULL) goto noarg;
printVars = TRUE;
- (void)Lst_AtEnd(variables, (ClientData)optarg);
+ (void)Lst_AtEnd(variables, argvalue);
Var_Append(MAKEFLAGS, "-V", VAR_GLOBAL);
- Var_Append(MAKEFLAGS, optarg, VAR_GLOBAL);
+ Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL);
break;
case 'W':
parseWarnFatal = TRUE;
@@ -363,116 +452,60 @@ rearg:
varNoExportEnv = TRUE;
Var_Append(MAKEFLAGS, "-X", VAR_GLOBAL);
break;
- case 'd': {
- char *modules = optarg;
-
- for (; *modules; ++modules)
- switch (*modules) {
- case 'A':
- debug = ~0;
- break;
- case 'a':
- debug |= DEBUG_ARCH;
- break;
- case 'c':
- debug |= DEBUG_COND;
- break;
- case 'd':
- debug |= DEBUG_DIR;
- break;
- case 'e':
- debug |= DEBUG_ERROR;
- break;
- case 'f':
- debug |= DEBUG_FOR;
- break;
- case 'g':
- if (modules[1] == '1') {
- debug |= DEBUG_GRAPH1;
- ++modules;
- }
- else if (modules[1] == '2') {
- debug |= DEBUG_GRAPH2;
- ++modules;
- }
- else if (modules[1] == '3') {
- debug |= DEBUG_GRAPH3;
- ++modules;
- }
- break;
- case 'j':
- debug |= DEBUG_JOB;
- break;
- case 'm':
- debug |= DEBUG_MAKE;
- break;
- case 'n':
- debug |= DEBUG_SCRIPT;
- break;
- case 's':
- debug |= DEBUG_SUFF;
- break;
- case 't':
- debug |= DEBUG_TARG;
- break;
- case 'v':
- debug |= DEBUG_VAR;
- break;
- case 'x':
- debug |= DEBUG_SHELL;
- break;
- default:
- (void)fprintf(stderr,
- "%s: illegal argument to d option -- %c\n",
- progname, *modules);
- usage();
- }
- Var_Append(MAKEFLAGS, "-d", VAR_GLOBAL);
- Var_Append(MAKEFLAGS, optarg, VAR_GLOBAL);
+ case 'd':
+ if (argvalue == NULL) goto noarg;
+ /* If '-d-opts' don't pass to children */
+ if (argvalue[0] == '-')
+ argvalue++;
+ else {
+ Var_Append(MAKEFLAGS, "-d", VAR_GLOBAL);
+ Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL);
+ }
+ parse_debug_options(argvalue);
break;
- }
case 'e':
checkEnvFirst = TRUE;
Var_Append(MAKEFLAGS, "-e", VAR_GLOBAL);
break;
case 'f':
- (void)Lst_AtEnd(makefiles, (ClientData)optarg);
+ if (argvalue == NULL) goto noarg;
+ (void)Lst_AtEnd(makefiles, argvalue);
break;
case 'i':
ignoreErrors = TRUE;
Var_Append(MAKEFLAGS, "-i", VAR_GLOBAL);
break;
case 'j':
+ if (argvalue == NULL) goto noarg;
forceJobs = TRUE;
- maxJobs = strtol(optarg, &p, 0);
+ maxJobs = strtol(argvalue, &p, 0);
if (*p != '\0' || maxJobs < 1) {
(void)fprintf(stderr, "%s: illegal argument to -j -- must be positive integer!\n",
progname);
exit(1);
}
-#ifndef REMOTE
- maxLocal = maxJobs;
-#endif
Var_Append(MAKEFLAGS, "-j", VAR_GLOBAL);
- Var_Append(MAKEFLAGS, optarg, VAR_GLOBAL);
+ Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL);
+ maxJobTokens = maxJobs;
break;
case 'k':
keepgoing = TRUE;
Var_Append(MAKEFLAGS, "-k", VAR_GLOBAL);
break;
case 'm':
+ if (argvalue == NULL) goto noarg;
/* look for magic parent directory search string */
- if (strncmp(".../", optarg, 4) == 0) {
- if (!Dir_FindHereOrAbove(curdir, optarg+4,
+ if (strncmp(".../", argvalue, 4) == 0) {
+ if (!Dir_FindHereOrAbove(curdir, argvalue+4,
found_path, sizeof(found_path)))
break; /* nothing doing */
(void)Dir_AddDir(sysIncPath, found_path);
} else {
- (void)Dir_AddDir(sysIncPath, optarg);
+ (void)Dir_AddDir(sysIncPath, argvalue);
}
Var_Append(MAKEFLAGS, "-m", VAR_GLOBAL);
- Var_Append(MAKEFLAGS, optarg, VAR_GLOBAL);
+ Var_Append(MAKEFLAGS, argvalue, VAR_GLOBAL);
break;
case 'n':
noExecute = TRUE;
@@ -525,8 +558,14 @@ rearg:
Punt("illegal (null) argument.");
if (*argv[1] == '-' && !dashDash)
goto rearg;
- (void)Lst_AtEnd(create, (ClientData)estrdup(argv[1]));
+ (void)Lst_AtEnd(create, estrdup(argv[1]));
}
+
+ return;
+noarg:
+ (void)fprintf(stderr, "%s: option requires an argument -- %c\n",
+ progname, c);
+ usage();
}
/*-
@@ -629,6 +668,18 @@ Main_SetObjdir(const char *path)
return rc;
}
+/*-
+ * ReadAllMakefiles --
+ * wrapper around ReadMakefile() to read all.
+ *
+ * Results:
+ * TRUE if ok, FALSE on error
+ */
+static int
+ReadAllMakefiles(ClientData p, ClientData q)
+{
+ return (ReadMakefile(p, q) == 0);
+}
/*-
* main --
@@ -651,7 +702,7 @@ int
main(int argc, char **argv)
{
Lst targs; /* target nodes to create -- passed to Make_Init */
- Boolean outOfDate = TRUE; /* FALSE if all targets up to date */
+ Boolean outOfDate = FALSE; /* FALSE if all targets up to date */
struct stat sb, sa;
char *p1, *path, *pwd;
char mdpath[MAXPATHLEN];
@@ -665,9 +716,15 @@ main(int argc, char **argv)
Lst sysMkPath; /* Path of sys.mk */
char *cp = NULL, *start;
/* avoid faults on read-only strings */
- static char defsyspath[] = DEFAULT_SYS_PATH;
+ static char defsyspath[] = _PATH_DEFSYSPATH;
char found_path[MAXPATHLEN + 1]; /* for searching for sys.mk */
struct timeval rightnow; /* to initialize random seed */
+#ifdef MAKE_NATIVE
+ struct utsname utsname;
+#endif
+
+ /* default to writing debug to stdout */
+ debug_file = stdout;
/*
* Set the seed to produce a different random sequences
@@ -739,8 +796,6 @@ main(int argc, char **argv)
*/
if (!machine) {
#ifdef MAKE_NATIVE
- struct utsname utsname;
-
if (uname(&utsname) == -1) {
(void)fprintf(stderr, "%s: uname failed (%s).\n", progname,
strerror(errno));
@@ -820,16 +875,11 @@ main(int argc, char **argv)
queryFlag = FALSE; /* This is not just a check-run */
noBuiltins = FALSE; /* Read the built-in rules */
touchFlag = FALSE; /* Actually update targets */
- usePipes = TRUE; /* Catch child output in pipes */
debug = 0; /* No debug verbosity, please. */
jobsRunning = FALSE;
- maxLocal = DEFMAXLOCAL; /* Set default local max concurrency */
-#ifdef REMOTE
- maxJobs = DEFMAXJOBS; /* Set default max concurrency */
-#else
- maxJobs = maxLocal;
-#endif
+ maxJobs = DEFMAXLOCAL; /* Set default local max concurrency */
+ maxJobTokens = maxJobs;
compatMake = FALSE; /* No compat mode */
@@ -854,6 +904,19 @@ main(int argc, char **argv)
Var_Set(".ALLTARGETS", "", VAR_GLOBAL, 0);
/*
+ * Set some other useful macros
+ */
+ {
+ char tmp[64];
+
+ snprintf(tmp, sizeof(tmp), "%u", getpid());
+ Var_Set(".MAKE.PID", tmp, VAR_GLOBAL, 0);
+ snprintf(tmp, sizeof(tmp), "%u", getppid());
+ Var_Set(".MAKE.PPID", tmp, VAR_GLOBAL, 0);
+ }
+ Job_SetPrefix();
+
+ /*
* First snag any flags out of the MAKE environment variable.
* (Note this is *not* MAKEFLAGS since /bin/make uses that and it's
* in a different format).
@@ -914,7 +977,7 @@ main(int argc, char **argv)
if (syspath == NULL || *syspath == '\0')
syspath = defsyspath;
else
- syspath = strdup(syspath);
+ syspath = estrdup(syspath);
for (start = syspath; *start != '\0'; start = cp) {
for (cp = start; *cp != '\0' && *cp != ':'; cp++)
@@ -950,8 +1013,8 @@ main(int argc, char **argv)
if (Lst_IsEmpty(sysMkPath))
Fatal("%s: no system rules (%s).", progname,
_PATH_DEFSYSMK);
- ln = Lst_Find(sysMkPath, (ClientData)NULL, ReadMakefile);
- if (ln != NILLNODE)
+ ln = Lst_Find(sysMkPath, NULL, ReadMakefile);
+ if (ln == NILLNODE)
Fatal("%s: cannot open %s.", progname,
(char *)Lst_Datum(ln));
}
@@ -959,24 +1022,29 @@ main(int argc, char **argv)
if (!Lst_IsEmpty(makefiles)) {
LstNode ln;
- ln = Lst_Find(makefiles, (ClientData)NULL, ReadMakefile);
+ ln = Lst_Find(makefiles, NULL, ReadAllMakefiles);
if (ln != NILLNODE)
Fatal("%s: cannot open %s.", progname,
(char *)Lst_Datum(ln));
- } else if (!ReadMakefile(UNCONST("makefile"), NULL))
+ } else if (ReadMakefile(UNCONST("makefile"), NULL) != 0)
(void)ReadMakefile(UNCONST("Makefile"), NULL);
- (void)ReadMakefile(UNCONST(".depend"), NULL);
+ /* In particular suppress .depend for '-r -V .OBJDIR -f /dev/null' */
+ if (!noBuiltins || !printVars) {
+ doing_depend = TRUE;
+ (void)ReadMakefile(UNCONST(".depend"), NULL);
+ doing_depend = FALSE;
+ }
Var_Append("MFLAGS", Var_Value(MAKEFLAGS, VAR_GLOBAL, &p1), VAR_GLOBAL);
if (p1)
free(p1);
- if (!jobServer && !compatMake)
- Job_ServerStart(maxJobs);
+ if (!compatMake)
+ Job_ServerStart(maxJobTokens, jp_0, jp_1);
if (DEBUG(JOB))
- printf("job_pipe %d %d, maxjobs %d maxlocal %d compat %d\n", job_pipe[0], job_pipe[1], maxJobs,
- maxLocal, compatMake);
+ fprintf(debug_file, "job_pipe %d %d, maxjobs %d, tokens %d, compat %d\n",
+ jp_0, jp_1, maxJobs, maxJobTokens, compatMake);
Main_ExportMAKEFLAGS(TRUE); /* initial export */
@@ -1049,40 +1117,40 @@ main(int argc, char **argv)
if (p1)
free(p1);
}
- }
-
- /*
- * Have now read the entire graph and need to make a list of targets
- * to create. If none was given on the command line, we consult the
- * parsing module to find the main target(s) to create.
- */
- if (Lst_IsEmpty(create))
- targs = Parse_MainName();
- else
- targs = Targ_FindList(create, TARG_CREATE);
-
- if (!compatMake && !printVars) {
+ } else {
/*
- * Initialize job module before traversing the graph, now that
- * any .BEGIN and .END targets have been read. This is done
- * only if the -q flag wasn't given (to prevent the .BEGIN from
- * being executed should it exist).
+ * Have now read the entire graph and need to make a list of
+ * targets to create. If none was given on the command line,
+ * we consult the parsing module to find the main target(s)
+ * to create.
*/
- if (!queryFlag) {
- if (maxLocal == -1)
- maxLocal = maxJobs;
- Job_Init(maxJobs, maxLocal);
- jobsRunning = TRUE;
- }
+ if (Lst_IsEmpty(create))
+ targs = Parse_MainName();
+ else
+ targs = Targ_FindList(create, TARG_CREATE);
+
+ if (!compatMake) {
+ /*
+ * Initialize job module before traversing the graph
+ * now that any .BEGIN and .END targets have been read.
+ * This is done only if the -q flag wasn't given
+ * (to prevent the .BEGIN from being executed should
+ * it exist).
+ */
+ if (!queryFlag) {
+ Job_Init();
+ jobsRunning = TRUE;
+ }
- /* Traverse the graph, checking on all the targets */
- outOfDate = Make_Run(targs);
- } else if (!printVars) {
- /*
- * Compat_Init will take care of creating all the targets as
- * well as initializing the module.
- */
- Compat_Run(targs);
+ /* Traverse the graph, checking on all the targets */
+ outOfDate = Make_Run(targs);
+ } else {
+ /*
+ * Compat_Init will take care of creating all the
+ * targets as well as initializing the module.
+ */
+ Compat_Run(targs);
+ }
}
#ifdef CLEANUP
@@ -1107,10 +1175,7 @@ main(int argc, char **argv)
Job_End();
Trace_End();
- if (queryFlag && outOfDate)
- return(1);
- else
- return(0);
+ return outOfDate ? 1 : 0;
}
/*-
@@ -1118,22 +1183,22 @@ main(int argc, char **argv)
* Open and parse the given makefile.
*
* Results:
- * TRUE if ok. FALSE if couldn't open file.
+ * 0 if ok. -1 if couldn't open file.
*
* Side Effects:
* lots
*/
-static Boolean
+static int
ReadMakefile(ClientData p, ClientData q __unused)
{
char *fname = p; /* makefile to read */
- FILE *stream;
+ int fd;
size_t len = MAXPATHLEN;
char *name, *path = emalloc(len);
int setMAKEFILE;
if (!strcmp(fname, "-")) {
- Parse_File("(stdin)", stdin);
+ Parse_File("(stdin)", dup(fileno(stdin)));
Var_Set("MAKEFILE", "", VAR_GLOBAL, 0);
} else {
setMAKEFILE = strcmp(fname, ".depend");
@@ -1145,7 +1210,8 @@ ReadMakefile(ClientData p, ClientData q __unused)
path = erealloc(path, len = 2 * plen);
(void)snprintf(path, len, "%s/%s", curdir, fname);
- if ((stream = fopen(path, "r")) != NULL) {
+ fd = open(path, O_RDONLY);
+ if (fd != -1) {
fname = path;
goto found;
}
@@ -1155,20 +1221,26 @@ ReadMakefile(ClientData p, ClientData q __unused)
if (len < plen)
path = erealloc(path, len = 2 * plen);
(void)snprintf(path, len, "%s/%s", objdir, fname);
- if ((stream = fopen(path, "r")) != NULL) {
+ fd = open(path, O_RDONLY);
+ if (fd != -1) {
fname = path;
goto found;
}
- } else if ((stream = fopen(fname, "r")) != NULL)
- goto found;
+ } else {
+ fd = open(fname, O_RDONLY);
+ if (fd != -1)
+ goto found;
+ }
/* look in -I and system include directories. */
name = Dir_FindFile(fname, parseIncPath);
if (!name)
name = Dir_FindFile(fname,
Lst_IsEmpty(sysIncPath) ? defIncPath : sysIncPath);
- if (!name || !(stream = fopen(name, "r"))) {
+ if (!name || (fd = open(name, O_RDONLY)) == -1) {
+ if (name)
+ free(name);
free(path);
- return(FALSE);
+ return(-1);
}
fname = name;
/*
@@ -1179,11 +1251,10 @@ ReadMakefile(ClientData p, ClientData q __unused)
found:
if (setMAKEFILE)
Var_Set("MAKEFILE", fname, VAR_GLOBAL, 0);
- Parse_File(fname, stream);
- (void)fclose(stream);
+ Parse_File(fname, fd);
}
free(path);
- return(TRUE);
+ return(0);
}
@@ -1269,7 +1340,7 @@ Check_Cwd_av(int ac, char **av, int copy)
n = strlen(av[i]);
cp = &(av[i])[n - 1];
- if (strspn(av[i], "|&;") == n) {
+ if (strspn(av[i], "|&;") == (size_t)n) {
next_cmd = 1;
continue;
} else if (*cp == ';' || *cp == '&' || *cp == '|' || *cp == ')') {
@@ -1355,10 +1426,10 @@ Check_Cwd_Cmd(const char *cmd)
bp = NULL;
}
cp = Check_Cwd_av(ac, av, 1);
- if (bp) {
- free(av);
+ if (bp)
free(bp);
- }
+ if (av)
+ free(av);
return cp;
}
@@ -1391,13 +1462,13 @@ Check_Cwd(const char **argv)
*
* Results:
* A string containing the output of the command, or the empty string
- * If err is not NULL, it contains the reason for the command failure
+ * If errnum is not NULL, it contains the reason for the command failure
*
* Side Effects:
* The string must be freed by the caller.
*/
char *
-Cmd_Exec(const char *cmd, const char **err)
+Cmd_Exec(const char *cmd, const char **errnum)
{
const char *args[4]; /* Args for invoking the shell */
int fds[2]; /* Pipe streams */
@@ -1410,7 +1481,7 @@ Cmd_Exec(const char *cmd, const char **err)
int cc;
- *err = NULL;
+ *errnum = NULL;
if (!shellName)
Shell_Init();
@@ -1426,7 +1497,7 @@ Cmd_Exec(const char *cmd, const char **err)
* Open a pipe for fetching its output
*/
if (pipe(fds) == -1) {
- *err = "Couldn't create pipe for \"%s\"";
+ *errnum = "Couldn't create pipe for \"%s\"";
goto bad;
}
@@ -1448,12 +1519,14 @@ Cmd_Exec(const char *cmd, const char **err)
(void)dup2(fds[1], 1);
(void)close(fds[1]);
+ Var_ExportVars();
+
(void)execv(shellPath, UNCONST(args));
_exit(1);
/*NOTREACHED*/
case -1:
- *err = "Couldn't exec \"%s\"";
+ *errnum = "Couldn't exec \"%s\"";
goto bad;
default:
@@ -1462,7 +1535,7 @@ Cmd_Exec(const char *cmd, const char **err)
*/
(void)close(fds[1]);
- buf = Buf_Init(MAKE_BSIZE);
+ buf = Buf_Init(0);
do {
char result[BUFSIZ];
@@ -1480,17 +1553,17 @@ Cmd_Exec(const char *cmd, const char **err)
/*
* Wait for the process to exit.
*/
- while(((pid = wait(&status)) != cpid) && (pid >= 0))
+ while(((pid = waitpid(cpid, &status, 0)) != cpid) && (pid >= 0))
continue;
res = (char *)Buf_GetAll(buf, &cc);
Buf_Destroy(buf, FALSE);
if (cc == 0)
- *err = "Couldn't read shell's output for \"%s\"";
+ *errnum = "Couldn't read shell's output for \"%s\"";
if (WAIT_STATUS(status))
- *err = "\"%s\" returned non-zero status";
+ *errnum = "\"%s\" returned non-zero status";
/*
* Null-terminate the result, convert newlines to spaces and
@@ -1564,7 +1637,6 @@ Fatal(const char *fmt, ...)
va_start(ap, fmt);
if (jobsRunning)
Job_Wait();
- Job_TokenFlush();
(void)vfprintf(stderr, fmt, ap);
va_end(ap);
@@ -1647,6 +1719,7 @@ Finish(int errors)
Fatal("%d error%s", errors, errors == 1 ? "" : "s");
}
+#ifndef HAVE_EMALLOC
/*
* emalloc --
* malloc, but die on error.
@@ -1676,6 +1749,20 @@ estrdup(const char *str)
}
/*
+ * estrndup --
+ * strndup, but die on error.
+ */
+char *
+estrndup(const char *str, size_t len)
+{
+ char *p;
+
+ if ((p = strndup(str, len)) == NULL)
+ enomem();
+ return(p);
+}
+
+/*
* erealloc --
* realloc, but die on error.
*/
@@ -1697,6 +1784,7 @@ enomem(void)
(void)fprintf(stderr, "%s: %s.\n", progname, strerror(errno));
exit(2);
}
+#endif
/*
* enunlink --
@@ -1777,16 +1865,20 @@ void
PrintOnError(const char *s)
{
char tmp[64];
-
+ char *cp;
+
if (s)
printf("%s", s);
printf("\n%s: stopped in %s\n", progname, curdir);
strncpy(tmp, "${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'\n@}",
sizeof(tmp) - 1);
- s = Var_Subst(NULL, tmp, VAR_GLOBAL, 0);
- if (s && *s)
- printf("%s", s);
+ cp = Var_Subst(NULL, tmp, VAR_GLOBAL, 0);
+ if (cp) {
+ if (*cp)
+ printf("%s", cp);
+ free(cp);
+ }
}
void
diff --git a/devel/bmake/files/make-conf.h b/devel/bmake/files/make-conf.h
index 6dc0164c376..bb37a637150 100644
--- a/devel/bmake/files/make-conf.h
+++ b/devel/bmake/files/make-conf.h
@@ -1,4 +1,4 @@
-/* $NetBSD: make-conf.h,v 1.1.1.2 2008/03/09 19:39:32 joerg Exp $ */
+/* $NetBSD: make-conf.h,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
diff --git a/devel/bmake/files/make.1 b/devel/bmake/files/make.1
index b861a916508..4528c144059 100644
--- a/devel/bmake/files/make.1
+++ b/devel/bmake/files/make.1
@@ -1,4 +1,4 @@
-.\" $NetBSD: make.1,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $
+.\" $NetBSD: make.1,v 1.2 2008/03/09 19:54:29 joerg Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
diff --git a/devel/bmake/files/make.c b/devel/bmake/files/make.c
index d313208b2e2..56105156f85 100644
--- a/devel/bmake/files/make.c
+++ b/devel/bmake/files/make.c
@@ -1,4 +1,4 @@
-/* $NetBSD: make.c,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $ */
+/* $NetBSD: make.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: make.c,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $";
+static char rcsid[] = "$NetBSD: make.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)make.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: make.c,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $");
+__RCSID("$NetBSD: make.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/make.h b/devel/bmake/files/make.h
index 46e752fe9b7..03d8ad6d2e9 100644
--- a/devel/bmake/files/make.h
+++ b/devel/bmake/files/make.h
@@ -1,4 +1,4 @@
-/* $NetBSD: make.h,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $ */
+/* $NetBSD: make.h,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
diff --git a/devel/bmake/files/makefile.boot.in b/devel/bmake/files/makefile.boot.in
index 28854745ee0..d2d57f6b715 100644
--- a/devel/bmake/files/makefile.boot.in
+++ b/devel/bmake/files/makefile.boot.in
@@ -1,5 +1,5 @@
# RCSid:
-# $Id: makefile.boot.in,v 1.6 2007/09/06 19:23:26 joerg Exp $
+# $Id: makefile.boot.in,v 1.7 2008/03/09 19:54:29 joerg Exp $
#
# modify MACHINE and MACHINE_ARCH as appropriate for your target architecture
@@ -13,24 +13,23 @@ MKDEP=$(srcdir)/mkdeps.sh -n -i/usr/include
MKDEP_OPTS=-A
MK=${prefix}/share/mk
MKSRC=@mksrc@
-MDEFS="-D@force_machine@MACHINE=\"@machine@\"" "-DMACHINE_ARCH=\"@machine_arch@\""
-
-DEFAULT_CSH = @DEFAULT_CSH@
-DEFAULT_KSH = @DEFAULT_KSH@
-DEFAULT_SH = @DEFAULT_SH@
-DEFAULT_SYS_PATH = @DEFAULT_SYS_PATH@
+# this is what we build into bmake
+DEFAULT_SYS_PATH = @default_sys_path@
+# this is what we might use during bootstrap
+BOOTSTRAP_SYS_PATH= `pwd`/mk:${MK}:${MKSRC}:${DEFAULT_SYS_PATH}:/usr/share/mk:/usr/local/share/mk:/opt/share/mk
-CFLAGS= @CFLAGS@ -I. -I$(srcdir) @DEFS@ @CPPFLAGS@ \
- -DDEFAULT_CSH=\"${DEFAULT_CSH}\" -DDEFAULT_KSH=\"${DEFAULT_KSH}\" \
- -DDEFAULT_SH=\"${DEFAULT_SH}\" -DDEFAULT_SYS_PATH=\"${DEFAULT_SYS_PATH}\"
+CFLAGS= @CFLAGS@ -I. -I$(srcdir) @DEFS@ @CPPFLAGS@ ${XDEFS} \
+ -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"
+MDEFS="-D@force_machine@MACHINE=\"@machine@\"" "-DMACHINE_ARCH=\"@machine_arch@\""
OBJ=arch.o buf.o compat.o cond.o dir.o for.o hash.o job.o main.o make.o \
parse.o str.o suff.o targ.o trace.o var.o util.o getopt.o sigcompat.o @LIBOBJS@
-BMAKE_ENV= CC="$(CC)" LIBC= MAKEFLAGS= MAKESYSPATH=${DEFAULT_MAKESYSPATH}
+BMAKE_ENV= CC="$(CC)" LIBC= MAKEFLAGS= MAKESYSPATH=${BOOTSTRAP_SYS_PATH}
bootstrap: bmake.boot .mk.done
${BMAKE_ENV} ./bmake.boot -f Makefile
+ ${BMAKE_ENV} ./bmake.boot -f Makefile bmake.1
${BMAKE_ENV} `pwd`/bmake -f Makefile test
bmake: bmake.boot
diff --git a/devel/bmake/files/missing/sys/cdefs.h b/devel/bmake/files/missing/sys/cdefs.h
index 3532281a3dc..97125c6a45f 100644
--- a/devel/bmake/files/missing/sys/cdefs.h
+++ b/devel/bmake/files/missing/sys/cdefs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: cdefs.h,v 1.3 2007/09/06 20:25:21 joerg Exp $ */
+/* $NetBSD: cdefs.h,v 1.4 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1991, 1993
diff --git a/devel/bmake/files/mkdeps.sh b/devel/bmake/files/mkdeps.sh
index 59723b99cd3..2019356db01 100755
--- a/devel/bmake/files/mkdeps.sh
+++ b/devel/bmake/files/mkdeps.sh
@@ -40,7 +40,7 @@
#
# RCSid:
-# $Id: mkdeps.sh,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $
+# $Id: mkdeps.sh,v 1.2 2008/03/09 19:54:29 joerg Exp $
#
# @(#) Copyright (c) 1993 Simon J. Gerraty
#
diff --git a/devel/bmake/files/nonints.h b/devel/bmake/files/nonints.h
index c6468fb65c6..6d47ff20ff0 100644
--- a/devel/bmake/files/nonints.h
+++ b/devel/bmake/files/nonints.h
@@ -1,4 +1,4 @@
-/* $NetBSD: nonints.h,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $ */
+/* $NetBSD: nonints.h,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*-
* Copyright (c) 1988, 1989, 1990, 1993
diff --git a/devel/bmake/files/os.sh b/devel/bmake/files/os.sh
index b07ca664a3e..bc0bfeed5e2 100644
--- a/devel/bmake/files/os.sh
+++ b/devel/bmake/files/os.sh
@@ -17,7 +17,7 @@
# Simon J. Gerraty <sjg@crufty.net>
# RCSid:
-# $Id: os.sh,v 1.2 2007/09/06 20:25:21 joerg Exp $
+# $Id: os.sh,v 1.3 2008/03/09 19:54:29 joerg Exp $
#
# @(#) Copyright (c) 1994 Simon J. Gerraty
#
diff --git a/devel/bmake/files/parse.c b/devel/bmake/files/parse.c
index 2a41b85f5c7..95527e45628 100644
--- a/devel/bmake/files/parse.c
+++ b/devel/bmake/files/parse.c
@@ -1,4 +1,4 @@
-/* $NetBSD: parse.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $ */
+/* $NetBSD: parse.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)parse.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: parse.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $");
+__RCSID("$NetBSD: parse.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/pathnames.h b/devel/bmake/files/pathnames.h
index 4895dd823c1..a54f889b295 100644
--- a/devel/bmake/files/pathnames.h
+++ b/devel/bmake/files/pathnames.h
@@ -1,4 +1,4 @@
-/* $NetBSD: pathnames.h,v 1.2 2007/09/06 19:23:26 joerg Exp $ */
+/* $NetBSD: pathnames.h,v 1.3 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1990, 1993
@@ -29,7 +29,7 @@
* SUCH DAMAGE.
*
* from: @(#)pathnames.h 5.2 (Berkeley) 6/1/90
- * $Id: pathnames.h,v 1.2 2007/09/06 19:23:26 joerg Exp $
+ * $Id: pathnames.h,v 1.3 2008/03/09 19:54:29 joerg Exp $
*/
#if HAVE_CONFIG_H
@@ -43,18 +43,17 @@
#ifdef HAVE_PATHS_H
#include <paths.h>
#endif
-
-#ifndef DEFAULT_CSH
-#define DEFAULT_CSH "/bin/csh"
-#endif
-#ifndef DEFAULT_KSH
-#define DEFAULT_KSH "/bin/ksh"
-#endif
-#ifndef DEFAULT_SH
-#define DEFAULT_SH "/bin/sh"
-#endif
-
#define _PATH_OBJDIR "obj"
#define _PATH_OBJDIRPREFIX "/usr/obj"
+#ifndef _PATH_DEFSHELLDIR
+#define _PATH_DEFSHELLDIR "/bin"
+#endif
#define _PATH_DEFSYSMK "sys.mk"
#define _path_defsyspath "/usr/share/mk:/usr/local/share/mk:/opt/share/mk"
+#ifndef _PATH_DEFSYSPATH
+# ifdef _PATH_PREFIX_SYSPATH
+# define _PATH_DEFSYSPATH _PATH_PREFIX_SYSPATH ":" _path_defsyspath
+# else
+# define _PATH_DEFSYSPATH _path_defsyspath
+# endif
+#endif
diff --git a/devel/bmake/files/ranlib.h b/devel/bmake/files/ranlib.h
index 75532ef58dc..e165006cb2c 100644
--- a/devel/bmake/files/ranlib.h
+++ b/devel/bmake/files/ranlib.h
@@ -1,5 +1,5 @@
/* @(#)ranlib.h 1.6 88/08/19 SMI; from UCB 4.1 83/05/03 */
-/* $Id: ranlib.h,v 1.2 2005/11/02 18:41:37 reed Exp $ */
+/* $Id: ranlib.h,v 1.3 2008/03/09 19:54:29 joerg Exp $ */
/*
* Structure of the __.SYMDEF table of contents for an archive.
diff --git a/devel/bmake/files/setenv.c b/devel/bmake/files/setenv.c
index a0d19527fb5..9e2b924fc3b 100644
--- a/devel/bmake/files/setenv.c
+++ b/devel/bmake/files/setenv.c
@@ -38,7 +38,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)setenv.c 5.6 (Berkeley) 6/4/91";*/
-static char *rcsid = "$Id: setenv.c,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $";
+static char *rcsid = "$Id: setenv.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#endif /* LIBC_SCCS and not lint */
#include <stddef.h>
diff --git a/devel/bmake/files/sigcompat.c b/devel/bmake/files/sigcompat.c
index 5d45363a766..91639ba4a7f 100644
--- a/devel/bmake/files/sigcompat.c
+++ b/devel/bmake/files/sigcompat.c
@@ -89,6 +89,9 @@
# include "config.h"
#endif
#include <signal.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#if defined(sun) && !(defined(__svr4__) || defined(__SVR4))
# define NO_SIGCOMPAT
@@ -98,7 +101,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
/*static char *sccsid = "from: @(#)sigcompat.c 5.3 (Berkeley) 2/24/91";*/
-static char *rcsid = "$Id: sigcompat.c,v 1.2 2007/04/15 11:23:07 tnn Exp $";
+static char *rcsid = "$Id: sigcompat.c,v 1.3 2008/03/09 19:54:29 joerg Exp $";
#endif /* LIBC_SCCS and not lint */
#undef signal
@@ -126,14 +129,14 @@ static char *rcsid = "$Id: sigcompat.c,v 1.2 2007/04/15 11:23:07 tnn Exp $";
#endif
#ifndef MASK_T
-# ifdef __hpux
+# if defined(__hpux__) || defined(__hpux)
# define MASK_T long
# else
# define MASK_T int
# endif
#endif
/* I just hate HPsUX */
-#if defined(__hpux) && !defined(__HPUX_VERSION)
+#if (defined(__HPUX_VERSION) && __HPUX_VERSION > 9) || defined(__hpux)
# define PAUSE_MASK_T int
#else
# define PAUSE_MASK_T MASK_T
diff --git a/devel/bmake/files/sprite.h b/devel/bmake/files/sprite.h
index 7f998061ad7..66599175975 100644
--- a/devel/bmake/files/sprite.h
+++ b/devel/bmake/files/sprite.h
@@ -1,4 +1,4 @@
-/* $NetBSD: sprite.h,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $ */
+/* $NetBSD: sprite.h,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
diff --git a/devel/bmake/files/str.c b/devel/bmake/files/str.c
index 04f27863bfe..f450c74502c 100644
--- a/devel/bmake/files/str.c
+++ b/devel/bmake/files/str.c
@@ -1,4 +1,4 @@
-/* $NetBSD: str.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $ */
+/* $NetBSD: str.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*-
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: str.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $";
+static char rcsid[] = "$NetBSD: str.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)str.c 5.8 (Berkeley) 6/1/90";
#else
-__RCSID("$NetBSD: str.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $");
+__RCSID("$NetBSD: str.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/suff.c b/devel/bmake/files/suff.c
index acfd62214e6..ebcd56d4f2d 100644
--- a/devel/bmake/files/suff.c
+++ b/devel/bmake/files/suff.c
@@ -1,4 +1,4 @@
-/* $NetBSD: suff.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $ */
+/* $NetBSD: suff.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: suff.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $";
+static char rcsid[] = "$NetBSD: suff.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)suff.c 8.4 (Berkeley) 3/21/94";
#else
-__RCSID("$NetBSD: suff.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $");
+__RCSID("$NetBSD: suff.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/targ.c b/devel/bmake/files/targ.c
index 18e1ce545fd..86e81cf014a 100644
--- a/devel/bmake/files/targ.c
+++ b/devel/bmake/files/targ.c
@@ -1,4 +1,4 @@
-/* $NetBSD: targ.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $ */
+/* $NetBSD: targ.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: targ.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $";
+static char rcsid[] = "$NetBSD: targ.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)targ.c 8.2 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: targ.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $");
+__RCSID("$NetBSD: targ.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/trace.c b/devel/bmake/files/trace.c
index 37992f5508b..21f954f2112 100644
--- a/devel/bmake/files/trace.c
+++ b/devel/bmake/files/trace.c
@@ -1,4 +1,4 @@
-/* $NetBSD: trace.c,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $ */
+/* $NetBSD: trace.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -38,11 +38,11 @@
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: trace.c,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $";
+static char rcsid[] = "$NetBSD: trace.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: trace.c,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $");
+__RCSID("$NetBSD: trace.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif /* not lint */
#endif
diff --git a/devel/bmake/files/trace.h b/devel/bmake/files/trace.h
index 3391c068de9..904dd67366f 100644
--- a/devel/bmake/files/trace.h
+++ b/devel/bmake/files/trace.h
@@ -1,4 +1,4 @@
-/* $NetBSD: trace.h,v 1.1.1.2 2008/03/09 19:39:33 joerg Exp $ */
+/* $NetBSD: trace.h,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
diff --git a/devel/bmake/files/unit-tests/Makefile.in b/devel/bmake/files/unit-tests/Makefile.in
index b28e2a97b6f..66eb90937bc 100644
--- a/devel/bmake/files/unit-tests/Makefile.in
+++ b/devel/bmake/files/unit-tests/Makefile.in
@@ -1,6 +1,6 @@
-# $Id: Makefile.in,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $
+# $Id: Makefile.in,v 1.2 2008/03/09 19:54:29 joerg Exp $
#
-# $NetBSD: Makefile.in,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $
+# $NetBSD: Makefile.in,v 1.2 2008/03/09 19:54:29 joerg Exp $
#
# Unit tests for make(1)
# The main targets are:
diff --git a/devel/bmake/files/unit-tests/cond1 b/devel/bmake/files/unit-tests/cond1
index 04c0a8780d4..76f884fefa4 100644
--- a/devel/bmake/files/unit-tests/cond1
+++ b/devel/bmake/files/unit-tests/cond1
@@ -1,4 +1,4 @@
-# $Id: cond1,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $
+# $Id: cond1,v 1.2 2008/03/09 19:54:29 joerg Exp $
# hard code these!
TEST_UNAME_S= NetBSD
diff --git a/devel/bmake/files/unit-tests/modorder b/devel/bmake/files/unit-tests/modorder
index c4310b44c7f..b8fb610323b 100644
--- a/devel/bmake/files/unit-tests/modorder
+++ b/devel/bmake/files/unit-tests/modorder
@@ -1,4 +1,4 @@
-# $NetBSD: modorder,v 1.1.1.2 2008/03/09 19:39:35 joerg Exp $
+# $NetBSD: modorder,v 1.2 2008/03/09 19:54:29 joerg Exp $
LIST= one two three four five six seven eight nine ten
LISTX= ${LIST:Ox}
diff --git a/devel/bmake/files/unit-tests/modword b/devel/bmake/files/unit-tests/modword
index 982378a2c9b..2dfac52fcd8 100644
--- a/devel/bmake/files/unit-tests/modword
+++ b/devel/bmake/files/unit-tests/modword
@@ -1,4 +1,4 @@
-# $Id: modword,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $
+# $Id: modword,v 1.2 2008/03/09 19:54:29 joerg Exp $
#
# Test behaviour of new :[] modifier
diff --git a/devel/bmake/files/unit-tests/posix b/devel/bmake/files/unit-tests/posix
index 7915112c883..82b08659831 100644
--- a/devel/bmake/files/unit-tests/posix
+++ b/devel/bmake/files/unit-tests/posix
@@ -1,4 +1,4 @@
-# $Id: posix,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $
+# $Id: posix,v 1.2 2008/03/09 19:54:29 joerg Exp $
all: x plus subs err
diff --git a/devel/bmake/files/unit-tests/varcmd b/devel/bmake/files/unit-tests/varcmd
index 62062f95be9..07acec94eaa 100644
--- a/devel/bmake/files/unit-tests/varcmd
+++ b/devel/bmake/files/unit-tests/varcmd
@@ -1,4 +1,4 @@
-# $Id: varcmd,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $
+# $Id: varcmd,v 1.2 2008/03/09 19:54:29 joerg Exp $
#
# Test behaviour of recursive make and vars set on command line.
diff --git a/devel/bmake/files/util.c b/devel/bmake/files/util.c
index 86fae960fed..4340198bfb3 100644
--- a/devel/bmake/files/util.c
+++ b/devel/bmake/files/util.c
@@ -1,18 +1,18 @@
-/* $NetBSD: util.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $ */
+/* $NetBSD: util.c,v 1.2 2008/03/09 19:54:29 joerg Exp $ */
/*
* Missing stuff from OS's
*
- * $Id: util.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $
+ * $Id: util.c,v 1.2 2008/03/09 19:54:29 joerg Exp $
*/
#include "make.h"
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: util.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $";
+static char rcsid[] = "$NetBSD: util.c,v 1.2 2008/03/09 19:54:29 joerg Exp $";
#else
#ifndef lint
-__RCSID("$NetBSD: util.c,v 1.1.1.2 2008/03/09 19:39:34 joerg Exp $");
+__RCSID("$NetBSD: util.c,v 1.2 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif
diff --git a/devel/bmake/files/var.c b/devel/bmake/files/var.c
index 16f97def0f2..d5265b99b2a 100644
--- a/devel/bmake/files/var.c
+++ b/devel/bmake/files/var.c
@@ -1,4 +1,4 @@
-/* $NetBSD: var.c,v 1.2 2005/12/02 00:14:56 sjg Exp $ */
+/* $NetBSD: var.c,v 1.3 2008/03/09 19:54:29 joerg Exp $ */
/*
* Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
*/
#ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: var.c,v 1.2 2005/12/02 00:14:56 sjg Exp $";
+static char rcsid[] = "$NetBSD: var.c,v 1.3 2008/03/09 19:54:29 joerg Exp $";
#else
#include <sys/cdefs.h>
#ifndef lint
#if 0
static char sccsid[] = "@(#)var.c 8.3 (Berkeley) 3/19/94";
#else
-__RCSID("$NetBSD: var.c,v 1.2 2005/12/02 00:14:56 sjg Exp $");
+__RCSID("$NetBSD: var.c,v 1.3 2008/03/09 19:54:29 joerg Exp $");
#endif
#endif /* not lint */
#endif
@@ -125,16 +125,7 @@ __RCSID("$NetBSD: var.c,v 1.2 2005/12/02 00:14:56 sjg Exp $");
#ifndef NO_REGEX
#include <sys/types.h>
-#include <nbcompat/nbconfig.h>
-/* bmake supplies its own <sys/cdefs.h> so this header is always present. */
-#ifndef HAVE_SYS_CDEFS_H
-#define HAVE_SYS_CDEFS_H 1
-#endif
-#if HAVE_REGEX_H
#include <regex.h>
-#else
-#include <nbcompat/regex.h>
-#endif
#endif
#include <ctype.h>
#include <stdlib.h>
@@ -142,6 +133,8 @@ __RCSID("$NetBSD: var.c,v 1.2 2005/12/02 00:14:56 sjg Exp $");
#include "make.h"
#include "buf.h"
+#include "dir.h"
+#include "job.h"
/*
* This is a harmless return value for Var_Parse that can be used by Var_Subst
@@ -151,7 +144,7 @@ __RCSID("$NetBSD: var.c,v 1.2 2005/12/02 00:14:56 sjg Exp $");
char var_Error[] = "";
/*
- * Similar to var_Error, but returned when the 'err' flag for Var_Parse is
+ * Similar to var_Error, but returned when the 'errnum' flag for Var_Parse is
* set false. Why not just use a constant? Well, gcc likes to condense
* identical string instances...
*/
@@ -194,8 +187,24 @@ typedef struct Var {
#define VAR_KEEP 8 /* Variable is VAR_JUNK, but we found
* a use for it in some modifier and
* the value is therefore valid */
+#define VAR_EXPORTED 16 /* Variable is exported */
+#define VAR_REEXPORT 32 /* Indicate if var needs re-export.
+ * This would be true if it contains $'s
+ */
} Var;
+/*
+ * Exporting vars is expensive so skip it if we can
+ */
+#define VAR_EXPORTED_NONE 0
+#define VAR_EXPORTED_YES 1
+#define VAR_EXPORTED_ALL 2
+static int var_exportedVars = VAR_EXPORTED_NONE;
+/*
+ * We pass this to Var_Export when doing the initial export
+ * or after updating an exported var.
+ */
+#define VAR_EXPORT_FORCE 1
/* Var*Pattern flags */
#define VAR_SUB_GLOBAL 0x01 /* Apply substitution globally */
@@ -239,7 +248,7 @@ typedef struct {
int tvarLen;
char *str; /* string to expand */
int strLen;
- int err; /* err for not defined */
+ int errnum; /* errnum for not defined */
} VarLoop_t;
#ifndef NO_REGEX
@@ -300,8 +309,6 @@ static char *VarUniq(const char *);
static int VarWordCompare(const void *, const void *);
static void VarPrintVar(ClientData);
-#define WR(a) ((char *)UNCONST(a))
-
#define BROPEN '{'
#define BRCLOSE '}'
#define PROPEN '('
@@ -396,7 +403,7 @@ VarFind(const char *name, GNode *ctxt, int flags)
len = strlen(env);
- v->val = Buf_Init(len);
+ v->val = Buf_Init(len + 1);
Buf_AddBytes(v->val, len, (Byte *)env);
v->flags = VAR_FROM_ENV;
@@ -422,6 +429,33 @@ VarFind(const char *name, GNode *ctxt, int flags)
/*-
*-----------------------------------------------------------------------
+ * VarFreeEnv --
+ * If the variable is an environment variable, free it
+ *
+ * Input:
+ * v the variable
+ * destroy true if the value buffer should be destroyed.
+ *
+ * Results:
+ * 1 if it is an environment variable 0 ow.
+ *
+ * Side Effects:
+ * The variable is free'ed if it is an environent variable.
+ *-----------------------------------------------------------------------
+ */
+static Boolean
+VarFreeEnv(Var *v, Boolean destroy)
+{
+ if ((v->flags & VAR_FROM_ENV) == 0)
+ return FALSE;
+ free(v->name);
+ Buf_Destroy(v->val, destroy);
+ free(v);
+ return TRUE;
+}
+
+/*-
+ *-----------------------------------------------------------------------
* VarAdd --
* Add a new variable of name name and value val to the given context
*
@@ -458,7 +492,7 @@ VarAdd(const char *name, const char *val, GNode *ctxt)
Hash_SetValue(h, v);
v->name = h->name;
if (DEBUG(VAR)) {
- printf("%s:%s = %s\n", ctxt->name, name, val);
+ fprintf(debug_file, "%s:%s = %s\n", ctxt->name, name, val);
}
}
@@ -480,14 +514,18 @@ Var_Delete(const char *name, GNode *ctxt)
{
Hash_Entry *ln;
+ ln = Hash_FindEntry(&ctxt->context, name);
if (DEBUG(VAR)) {
- printf("%s:delete %s\n", ctxt->name, name);
+ fprintf(debug_file, "%s:delete %s%s\n",
+ ctxt->name, name, ln ? "" : " (not found)");
}
- ln = Hash_FindEntry(&ctxt->context, name);
if (ln != NULL) {
Var *v;
v = (Var *)Hash_GetValue(ln);
+ if ((v->flags & VAR_EXPORTED)) {
+ unsetenv(v->name);
+ }
if (v->name != ln->name)
free(v->name);
Hash_DeleteEntry(&ctxt->context, ln);
@@ -496,6 +534,177 @@ Var_Delete(const char *name, GNode *ctxt)
}
}
+
+/*
+ * Export a var.
+ * We ignore make internal variables (those which start with '.')
+ * Also we jump through some hoops to avoid calling setenv
+ * more than necessary since it can leak.
+ */
+static int
+Var_Export1(const char *name, int force)
+{
+ char tmp[BUFSIZ];
+ Var *v;
+ char *val = NULL;
+ int n;
+
+ if (*name == '.')
+ return 0; /* skip internals */
+ if (!name[1]) {
+ /*
+ * A single char.
+ * If it is one of the vars that should only appear in
+ * local context, skip it, else we can get Var_Subst
+ * into a loop.
+ */
+ switch (name[0]) {
+ case '@':
+ case '%':
+ case '*':
+ case '!':
+ return 0;
+ }
+ }
+ v = VarFind(name, VAR_GLOBAL, 0);
+ if (v == (Var *)NIL) {
+ return 0;
+ }
+ if (!force &&
+ (v->flags & (VAR_EXPORTED|VAR_REEXPORT)) == VAR_EXPORTED) {
+ return 0; /* nothing to do */
+ }
+ val = (char *)Buf_GetAll(v->val, NULL);
+ if (strchr(val, '$')) {
+ /* Flag this as something we need to re-export */
+ v->flags |= (VAR_EXPORTED|VAR_REEXPORT);
+ if (force) {
+ /*
+ * No point actually exporting it now though,
+ * the child can do it at the last minute.
+ */
+ return 1;
+ }
+ n = snprintf(tmp, sizeof(tmp), "${%s}", name);
+ if (n < sizeof(tmp)) {
+ val = Var_Subst(NULL, tmp, VAR_GLOBAL, 0);
+ setenv(name, val, 1);
+ free(val);
+ }
+ } else {
+ v->flags &= ~VAR_REEXPORT; /* once will do */
+ if (force || !(v->flags & VAR_EXPORTED)) {
+ setenv(name, val, 1);
+ }
+ }
+ /*
+ * This is so Var_Set knows to call Var_Export again...
+ */
+ v->flags |= VAR_EXPORTED;
+ return 1;
+}
+
+/*
+ * This gets called from our children.
+ */
+void
+Var_ExportVars(void)
+{
+ char tmp[BUFSIZ];
+ Hash_Entry *var;
+ Hash_Search state;
+ Var *v;
+ char *val;
+ int n;
+
+ if (VAR_EXPORTED_NONE == var_exportedVars)
+ return;
+
+ if (VAR_EXPORTED_ALL == var_exportedVars) {
+ /*
+ * Ouch! This is crazy...
+ */
+ for (var = Hash_EnumFirst(&VAR_GLOBAL->context, &state);
+ var != NULL;
+ var = Hash_EnumNext(&state)) {
+ v = (Var *)Hash_GetValue(var);
+ Var_Export1(v->name, 0);
+ }
+ return;
+ }
+ /*
+ * We have a number of exported vars,
+ */
+ n = snprintf(tmp, sizeof(tmp), "${" MAKE_EXPORTED ":O:u}");
+ if (n < sizeof(tmp)) {
+ char **av;
+ char *as;
+ int ac;
+ int i;
+
+ val = Var_Subst(NULL, tmp, VAR_GLOBAL, 0);
+ av = brk_string(val, &ac, FALSE, &as);
+ for (i = 0; i < ac; i++) {
+ Var_Export1(av[i], 0);
+ }
+ free(val);
+ free(as);
+ free(av);
+ }
+}
+
+/*
+ * This is called when .export is seen or
+ * .MAKE.EXPORTED is modified.
+ * It is also called when any exported var is modified.
+ */
+void
+Var_Export(char *str, int isExport)
+{
+ char *name;
+ char *val;
+ char **av;
+ char *as;
+ int ac;
+ int i;
+
+ if (isExport && (!str || !str[0])) {
+ var_exportedVars = VAR_EXPORTED_ALL; /* use with caution! */
+ return;
+ }
+
+ val = Var_Subst(NULL, str, VAR_GLOBAL, 0);
+ av = brk_string(val, &ac, FALSE, &as);
+ for (i = 0; i < ac; i++) {
+ name = av[i];
+ if (!name[1]) {
+ /*
+ * A single char.
+ * If it is one of the vars that should only appear in
+ * local context, skip it, else we can get Var_Subst
+ * into a loop.
+ */
+ switch (name[0]) {
+ case '@':
+ case '%':
+ case '*':
+ case '!':
+ continue;
+ }
+ }
+ if (Var_Export1(name, VAR_EXPORT_FORCE)) {
+ if (VAR_EXPORTED_ALL != var_exportedVars)
+ var_exportedVars = VAR_EXPORTED_YES;
+ if (isExport) {
+ Var_Append(MAKE_EXPORTED, name, VAR_GLOBAL);
+ }
+ }
+ }
+ free(val);
+ free(as);
+ free(av);
+}
+
/*-
*-----------------------------------------------------------------------
* Var_Set --
@@ -545,7 +754,10 @@ Var_Set(const char *name, const char *val, GNode *ctxt, int flags)
Buf_AddBytes(v->val, strlen(val), (const Byte *)val);
if (DEBUG(VAR)) {
- printf("%s:%s = %s\n", ctxt->name, name, val);
+ fprintf(debug_file, "%s:%s = %s\n", ctxt->name, name, val);
+ }
+ if ((v->flags & VAR_EXPORTED)) {
+ Var_Export1(name, VAR_EXPORT_FORCE);
}
}
/*
@@ -567,6 +779,8 @@ Var_Set(const char *name, const char *val, GNode *ctxt, int flags)
}
if (name != cp)
free(UNCONST(name));
+ if (v != (Var *)NIL)
+ VarFreeEnv(v, TRUE);
}
/*-
@@ -617,7 +831,7 @@ Var_Append(const char *name, const char *val, GNode *ctxt)
Buf_AddBytes(v->val, strlen(val), (const Byte *)val);
if (DEBUG(VAR)) {
- printf("%s:%s = %s\n", ctxt->name, name,
+ fprintf(debug_file, "%s:%s = %s\n", ctxt->name, name,
(char *)Buf_GetAll(v->val, NULL));
}
@@ -663,10 +877,8 @@ Var_Exists(const char *name, GNode *ctxt)
if (v == (Var *)NIL) {
return(FALSE);
- } else if (v->flags & VAR_FROM_ENV) {
- free(v->name);
- Buf_Destroy(v->val, TRUE);
- free(v);
+ } else {
+ (void)VarFreeEnv(v, TRUE);
}
return(TRUE);
}
@@ -696,12 +908,8 @@ Var_Value(const char *name, GNode *ctxt, char **frp)
*frp = NULL;
if (v != (Var *)NIL) {
char *p = ((char *)Buf_GetAll(v->val, NULL));
- if (v->flags & VAR_FROM_ENV) {
- free(v->name);
- Buf_Destroy(v->val, FALSE);
- free(v);
+ if (VarFreeEnv(v, FALSE))
*frp = p;
- }
return p;
} else {
return (NULL);
@@ -1203,14 +1411,14 @@ VarSubstitute(GNode *ctx __unused, Var_Parse_State *vpstate,
*-----------------------------------------------------------------------
*/
static void
-VarREError(int err, regex_t *pat, const char *str)
+VarREError(int errnum, regex_t *pat, const char *str)
{
char *errbuf;
int errlen;
- errlen = regerror(err, pat, 0, 0);
+ errlen = regerror(errnum, pat, 0, 0);
errbuf = emalloc(errlen);
- regerror(err, pat, errbuf, errlen);
+ regerror(errnum, pat, errbuf, errlen);
Error("%s: %s", str, errbuf);
free(errbuf);
}
@@ -1381,7 +1589,7 @@ VarLoopExpand(GNode *ctx __unused, Var_Parse_State *vpstate __unused,
if (word && *word) {
Var_Set(loop->tvar, word, loop->ctxt, VAR_NO_EXPORT);
- s = Var_Subst(NULL, loop->str, loop->ctxt, loop->err);
+ s = Var_Subst(NULL, loop->str, loop->ctxt, loop->errnum);
if (s != NULL && *s != '\0') {
if (addSpace && *s != '\n')
Buf_AddByte(buf, ' ');
@@ -1433,7 +1641,7 @@ VarSelectWords(GNode *ctx __unused, Var_Parse_State *vpstate,
/* fake what brk_string() would do if there were only one word */
ac = 1;
av = emalloc((ac + 1) * sizeof(char *));
- as = strdup(str);
+ as = estrdup(str);
av[0] = as;
av[1] = NULL;
} else {
@@ -1526,7 +1734,7 @@ VarModify(GNode *ctx, Var_Parse_State *vpstate,
/* fake what brk_string() would do if there were only one word */
ac = 1;
av = emalloc((ac + 1) * sizeof(char *));
- as = strdup(str);
+ as = estrdup(str);
av[0] = as;
av[1] = NULL;
} else {
@@ -1700,7 +1908,7 @@ VarUniq(const char *str)
*/
static char *
VarGetPattern(GNode *ctxt, Var_Parse_State *vpstate __unused,
- int err, const char **tstr, int delim, int *flags,
+ int errnum, const char **tstr, int delim, int *flags,
int *length, VarPattern *pattern)
{
const char *cp;
@@ -1737,17 +1945,17 @@ VarGetPattern(GNode *ctxt, Var_Parse_State *vpstate __unused,
if (flags == NULL || (*flags & VAR_NOSUBST) == 0) {
char *cp2;
int len;
- Boolean freeIt;
+ void *freeIt;
/*
* If unescaped dollar sign not before the
* delimiter, assume it's a variable
* substitution and recurse.
*/
- cp2 = Var_Parse(cp, ctxt, err, &len, &freeIt);
+ cp2 = Var_Parse(cp, ctxt, errnum, &len, &freeIt);
Buf_AddBytes(buf, strlen(cp2), (Byte *)cp2);
if (freeIt)
- free(cp2);
+ free(freeIt);
cp += len - 1;
} else {
const char *cp2 = &cp[1];
@@ -1820,12 +2028,19 @@ VarQuote(char *str)
Buffer buf;
/* This should cover most shells :-( */
static char meta[] = "\n \t'`\";&<>()|*?{}[]\\$!#^~";
+ const char *newline;
- buf = Buf_Init(MAKE_BSIZE);
+ newline = Shell_GetNewline();
+
+ buf = Buf_Init(0);
for (; *str; str++) {
- if (strchr(meta, *str) != NULL)
- Buf_AddByte(buf, (Byte)'\\');
- Buf_AddByte(buf, (Byte)*str);
+ if (*str == '\n' && newline != NULL) {
+ Buf_AddBytes(buf, strlen(newline), newline);
+ } else {
+ if (strchr(meta, *str) != NULL)
+ Buf_AddByte(buf, (Byte)'\\');
+ Buf_AddByte(buf, (Byte)*str);
+ }
}
Buf_AddByte(buf, (Byte)'\0');
str = (char *)Buf_GetAll(buf, NULL);
@@ -1857,7 +2072,7 @@ VarChangeCase(char *str, int upper)
int (*modProc)(int);
modProc = (upper ? toupper : tolower);
- buf = Buf_Init(MAKE_BSIZE);
+ buf = Buf_Init(0);
for (; *str ; str++) {
Buf_AddByte(buf, (Byte)modProc(*str));
}
@@ -1867,6 +2082,1110 @@ VarChangeCase(char *str, int upper)
return str;
}
+/*
+ * Now we need to apply any modifiers the user wants applied.
+ * These are:
+ * :M<pattern> words which match the given <pattern>.
+ * <pattern> is of the standard file
+ * wildcarding form.
+ * :N<pattern> words which do not match the given <pattern>.
+ * :S<d><pat1><d><pat2><d>[1gW]
+ * Substitute <pat2> for <pat1> in the value
+ * :C<d><pat1><d><pat2><d>[1gW]
+ * Substitute <pat2> for regex <pat1> in the value
+ * :H Substitute the head of each word
+ * :T Substitute the tail of each word
+ * :E Substitute the extension (minus '.') of
+ * each word
+ * :R Substitute the root of each word
+ * (pathname minus the suffix).
+ * :O ("Order") Alphabeticaly sort words in variable.
+ * :Ox ("intermiX") Randomize words in variable.
+ * :u ("uniq") Remove adjacent duplicate words.
+ * :tu Converts the variable contents to uppercase.
+ * :tl Converts the variable contents to lowercase.
+ * :ts[c] Sets varSpace - the char used to
+ * separate words to 'c'. If 'c' is
+ * omitted then no separation is used.
+ * :tW Treat the variable contents as a single
+ * word, even if it contains spaces.
+ * (Mnemonic: one big 'W'ord.)
+ * :tw Treat the variable contents as multiple
+ * space-separated words.
+ * (Mnemonic: many small 'w'ords.)
+ * :[index] Select a single word from the value.
+ * :[start..end] Select multiple words from the value.
+ * :[*] or :[0] Select the entire value, as a single
+ * word. Equivalent to :tW.
+ * :[@] Select the entire value, as multiple
+ * words. Undoes the effect of :[*].
+ * Equivalent to :tw.
+ * :[#] Returns the number of words in the value.
+ *
+ * :?<true-value>:<false-value>
+ * If the variable evaluates to true, return
+ * true value, else return the second value.
+ * :lhs=rhs Like :S, but the rhs goes to the end of
+ * the invocation.
+ * :sh Treat the current value as a command
+ * to be run, new value is its output.
+ * The following added so we can handle ODE makefiles.
+ * :@<tmpvar>@<newval>@
+ * Assign a temporary local variable <tmpvar>
+ * to the current value of each word in turn
+ * and replace each word with the result of
+ * evaluating <newval>
+ * :D<newval> Use <newval> as value if variable defined
+ * :U<newval> Use <newval> as value if variable undefined
+ * :L Use the name of the variable as the value.
+ * :P Use the path of the node that has the same
+ * name as the variable as the value. This
+ * basically includes an implied :L so that
+ * the common method of refering to the path
+ * of your dependent 'x' in a rule is to use
+ * the form '${x:P}'.
+ * :!<cmd>! Run cmd much the same as :sh run's the
+ * current value of the variable.
+ * The ::= modifiers, actually assign a value to the variable.
+ * Their main purpose is in supporting modifiers of .for loop
+ * iterators and other obscure uses. They always expand to
+ * nothing. In a target rule that would otherwise expand to an
+ * empty line they can be preceded with @: to keep make happy.
+ * Eg.
+ *
+ * foo: .USE
+ * .for i in ${.TARGET} ${.TARGET:R}.gz
+ * @: ${t::=$i}
+ * @echo blah ${t:T}
+ * .endfor
+ *
+ * ::=<str> Assigns <str> as the new value of variable.
+ * ::?=<str> Assigns <str> as value of variable if
+ * it was not already set.
+ * ::+=<str> Appends <str> to variable.
+ * ::!=<cmd> Assigns output of <cmd> as the new value of
+ * variable.
+ */
+
+static char *
+ApplyModifiers(char *nstr, const char *tstr,
+ int startc, int endc,
+ Var *v, GNode *ctxt, Boolean errnum,
+ int *lengthPtr, void **freePtr)
+{
+ const char *start;
+ const char *cp; /* Secondary pointer into str (place marker
+ * for tstr) */
+ char *newStr; /* New value to return */
+ char termc; /* Character which terminated scan */
+ int cnt; /* Used to count brace pairs when variable in
+ * in parens or braces */
+ char delim;
+ int modifier; /* that we are processing */
+ Var_Parse_State parsestate; /* Flags passed to helper functions */
+
+ delim = '\0';
+ parsestate.oneBigWord = FALSE;
+ parsestate.varSpace = ' '; /* word separator */
+
+ start = cp = tstr;
+
+ while (*tstr && *tstr != endc) {
+
+ if (*tstr == '$') {
+ /*
+ * We have some complex modifiers in a variable.
+ */
+ void *freeIt;
+ char *rval;
+ int rlen;
+
+ rval = Var_Parse(tstr, ctxt, errnum, &rlen, &freeIt);
+
+ if (DEBUG(VAR)) {
+ fprintf(debug_file, "Got '%s' from '%.*s'%.*s\n",
+ rval, rlen, tstr, rlen, tstr + rlen);
+ }
+
+ tstr += rlen;
+
+ if (rval != NULL && *rval) {
+ int used;
+
+ nstr = ApplyModifiers(nstr, rval,
+ 0, 0,
+ v, ctxt, errnum, &used, freePtr);
+ if (nstr == var_Error
+ || (nstr == varNoError && errnum == 0)
+ || strlen(rval) != (size_t) used) {
+ if (freeIt)
+ free(freeIt);
+ goto out; /* error already reported */
+ }
+ }
+ if (freeIt)
+ free(freeIt);
+ if (*tstr == ':')
+ tstr++;
+ else if (!*tstr && endc) {
+ Error("Unclosed variable specification for %s", v->name);
+ goto out;
+ }
+ continue;
+ }
+ if (DEBUG(VAR)) {
+ fprintf(debug_file, "Applying :%c to \"%s\"\n", *tstr, nstr);
+ }
+ newStr = var_Error;
+ switch ((modifier = *tstr)) {
+ case ':':
+ {
+ if (tstr[1] == '=' ||
+ (tstr[2] == '=' &&
+ (tstr[1] == '!' || tstr[1] == '+' || tstr[1] == '?'))) {
+ /*
+ * "::=", "::!=", "::+=", or "::?="
+ */
+ GNode *v_ctxt; /* context where v belongs */
+ const char *emsg;
+ char *sv_name;
+ VarPattern pattern;
+ int how;
+
+ v_ctxt = ctxt;
+ sv_name = NULL;
+ ++tstr;
+ if (v->flags & VAR_JUNK) {
+ /*
+ * We need to estrdup() it incase
+ * VarGetPattern() recurses.
+ */
+ sv_name = v->name;
+ v->name = estrdup(v->name);
+ } else if (ctxt != VAR_GLOBAL) {
+ Var *gv = VarFind(v->name, ctxt, 0);
+ if (gv == (Var *)NIL)
+ v_ctxt = VAR_GLOBAL;
+ else
+ VarFreeEnv(gv, TRUE);
+ }
+
+ switch ((how = *tstr)) {
+ case '+':
+ case '?':
+ case '!':
+ cp = &tstr[2];
+ break;
+ default:
+ cp = ++tstr;
+ break;
+ }
+ delim = BRCLOSE;
+ pattern.flags = 0;
+
+ pattern.rhs = VarGetPattern(ctxt, &parsestate, errnum,
+ &cp, delim, NULL,
+ &pattern.rightLen,
+ NULL);
+ if (v->flags & VAR_JUNK) {
+ /* restore original name */
+ free(v->name);
+ v->name = sv_name;
+ }
+ if (pattern.rhs == NULL)
+ goto cleanup;
+
+ termc = *--cp;
+ delim = '\0';
+
+ switch (how) {
+ case '+':
+ Var_Append(v->name, pattern.rhs, v_ctxt);
+ break;
+ case '!':
+ newStr = Cmd_Exec(pattern.rhs, &emsg);
+ if (emsg)
+ Error(emsg, nstr);
+ else
+ Var_Set(v->name, newStr, v_ctxt, 0);
+ if (newStr)
+ free(newStr);
+ break;
+ case '?':
+ if ((v->flags & VAR_JUNK) == 0)
+ break;
+ /* FALLTHROUGH */
+ default:
+ Var_Set(v->name, pattern.rhs, v_ctxt, 0);
+ break;
+ }
+ free(UNCONST(pattern.rhs));
+ newStr = var_Error;
+ break;
+ }
+ goto default_case; /* "::<unrecognised>" */
+ }
+ case '@':
+ {
+ VarLoop_t loop;
+ int flags = VAR_NOSUBST;
+
+ cp = ++tstr;
+ delim = '@';
+ if ((loop.tvar = VarGetPattern(ctxt, &parsestate, errnum,
+ &cp, delim,
+ &flags, &loop.tvarLen,
+ NULL)) == NULL)
+ goto cleanup;
+
+ if ((loop.str = VarGetPattern(ctxt, &parsestate, errnum,
+ &cp, delim,
+ &flags, &loop.strLen,
+ NULL)) == NULL)
+ goto cleanup;
+
+ termc = *cp;
+ delim = '\0';
+
+ loop.errnum = errnum;
+ loop.ctxt = ctxt;
+ newStr = VarModify(ctxt, &parsestate, nstr, VarLoopExpand,
+ &loop);
+ free(loop.tvar);
+ free(loop.str);
+ break;
+ }
+ case 'D':
+ case 'U':
+ {
+ Buffer buf; /* Buffer for patterns */
+ int wantit; /* want data in buffer */
+
+ /*
+ * Pass through tstr looking for 1) escaped delimiters,
+ * '$'s and backslashes (place the escaped character in
+ * uninterpreted) and 2) unescaped $'s that aren't before
+ * the delimiter (expand the variable substitution).
+ * The result is left in the Buffer buf.
+ */
+ buf = Buf_Init(0);
+ for (cp = tstr + 1;
+ *cp != endc && *cp != ':' && *cp != '\0';
+ cp++) {
+ if ((*cp == '\\') &&
+ ((cp[1] == ':') ||
+ (cp[1] == '$') ||
+ (cp[1] == endc) ||
+ (cp[1] == '\\')))
+ {
+ Buf_AddByte(buf, (Byte)cp[1]);
+ cp++;
+ } else if (*cp == '$') {
+ /*
+ * If unescaped dollar sign, assume it's a
+ * variable substitution and recurse.
+ */
+ char *cp2;
+ int len;
+ void *freeIt;
+
+ cp2 = Var_Parse(cp, ctxt, errnum, &len, &freeIt);
+ Buf_AddBytes(buf, strlen(cp2), (Byte *)cp2);
+ if (freeIt)
+ free(freeIt);
+ cp += len - 1;
+ } else {
+ Buf_AddByte(buf, (Byte)*cp);
+ }
+ }
+ Buf_AddByte(buf, (Byte)'\0');
+
+ termc = *cp;
+
+ if (*tstr == 'U')
+ wantit = ((v->flags & VAR_JUNK) != 0);
+ else
+ wantit = ((v->flags & VAR_JUNK) == 0);
+ if ((v->flags & VAR_JUNK) != 0)
+ v->flags |= VAR_KEEP;
+ if (wantit) {
+ newStr = (char *)Buf_GetAll(buf, NULL);
+ Buf_Destroy(buf, FALSE);
+ } else {
+ newStr = nstr;
+ Buf_Destroy(buf, TRUE);
+ }
+ break;
+ }
+ case 'L':
+ {
+ if ((v->flags & VAR_JUNK) != 0)
+ v->flags |= VAR_KEEP;
+ newStr = estrdup(v->name);
+ cp = ++tstr;
+ termc = *tstr;
+ break;
+ }
+ case 'P':
+ {
+ GNode *gn;
+
+ if ((v->flags & VAR_JUNK) != 0)
+ v->flags |= VAR_KEEP;
+ gn = Targ_FindNode(v->name, TARG_NOCREATE);
+ if (gn == NILGNODE || gn->type & OP_NOPATH) {
+ newStr = NULL;
+ } else if (gn->path) {
+ newStr = estrdup(gn->path);
+ } else {
+ newStr = Dir_FindFile(v->name, Suff_FindPath(gn));
+ }
+ if (!newStr) {
+ newStr = estrdup(v->name);
+ }
+ cp = ++tstr;
+ termc = *tstr;
+ break;
+ }
+ case '!':
+ {
+ const char *emsg;
+ VarPattern pattern;
+ pattern.flags = 0;
+
+ delim = '!';
+
+ cp = ++tstr;
+ if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, errnum,
+ &cp, delim,
+ NULL, &pattern.rightLen,
+ NULL)) == NULL)
+ goto cleanup;
+ newStr = Cmd_Exec(pattern.rhs, &emsg);
+ free(UNCONST(pattern.rhs));
+ if (emsg)
+ Error(emsg, nstr);
+ termc = *cp;
+ delim = '\0';
+ if (v->flags & VAR_JUNK) {
+ v->flags |= VAR_KEEP;
+ }
+ break;
+ }
+ case '[':
+ {
+ /*
+ * Look for the closing ']', recursively
+ * expanding any embedded variables.
+ *
+ * estr is a pointer to the expanded result,
+ * which we must free().
+ */
+ char *estr;
+
+ cp = tstr+1; /* point to char after '[' */
+ delim = ']'; /* look for closing ']' */
+ estr = VarGetPattern(ctxt, &parsestate,
+ errnum, &cp, delim,
+ NULL, NULL, NULL);
+ if (estr == NULL)
+ goto cleanup; /* report missing ']' */
+ /* now cp points just after the closing ']' */
+ delim = '\0';
+ if (cp[0] != ':' && cp[0] != endc) {
+ /* Found junk after ']' */
+ free(estr);
+ goto bad_modifier;
+ }
+ if (estr[0] == '\0') {
+ /* Found empty square brackets in ":[]". */
+ free(estr);
+ goto bad_modifier;
+ } else if (estr[0] == '#' && estr[1] == '\0') {
+ /* Found ":[#]" */
+
+ /*
+ * We will need enough space for the decimal
+ * representation of an int. We calculate the
+ * space needed for the octal representation,
+ * and add enough slop to cope with a '-' sign
+ * (which should never be needed) and a '\0'
+ * string terminator.
+ */
+ int newStrSize =
+ (sizeof(int) * CHAR_BIT + 2) / 3 + 2;
+
+ newStr = emalloc(newStrSize);
+ if (parsestate.oneBigWord) {
+ strncpy(newStr, "1", newStrSize);
+ } else {
+ /* XXX: brk_string() is a rather expensive
+ * way of counting words. */
+ char **av;
+ char *as;
+ int ac;
+
+ av = brk_string(nstr, &ac, FALSE, &as);
+ snprintf(newStr, newStrSize, "%d", ac);
+ free(as);
+ free(av);
+ }
+ termc = *cp;
+ free(estr);
+ break;
+ } else if (estr[0] == '*' && estr[1] == '\0') {
+ /* Found ":[*]" */
+ parsestate.oneBigWord = TRUE;
+ newStr = nstr;
+ termc = *cp;
+ free(estr);
+ break;
+ } else if (estr[0] == '@' && estr[1] == '\0') {
+ /* Found ":[@]" */
+ parsestate.oneBigWord = FALSE;
+ newStr = nstr;
+ termc = *cp;
+ free(estr);
+ break;
+ } else {
+ /*
+ * We expect estr to contain a single
+ * integer for :[N], or two integers
+ * separated by ".." for :[start..end].
+ */
+ char *ep;
+
+ VarSelectWords_t seldata = { 0, 0 };
+
+ seldata.start = strtol(estr, &ep, 0);
+ if (ep == estr) {
+ /* Found junk instead of a number */
+ free(estr);
+ goto bad_modifier;
+ } else if (ep[0] == '\0') {
+ /* Found only one integer in :[N] */
+ seldata.end = seldata.start;
+ } else if (ep[0] == '.' && ep[1] == '.' &&
+ ep[2] != '\0') {
+ /* Expecting another integer after ".." */
+ ep += 2;
+ seldata.end = strtol(ep, &ep, 0);
+ if (ep[0] != '\0') {
+ /* Found junk after ".." */
+ free(estr);
+ goto bad_modifier;
+ }
+ } else {
+ /* Found junk instead of ".." */
+ free(estr);
+ goto bad_modifier;
+ }
+ /*
+ * Now seldata is properly filled in,
+ * but we still have to check for 0 as
+ * a special case.
+ */
+ if (seldata.start == 0 && seldata.end == 0) {
+ /* ":[0]" or perhaps ":[0..0]" */
+ parsestate.oneBigWord = TRUE;
+ newStr = nstr;
+ termc = *cp;
+ free(estr);
+ break;
+ } else if (seldata.start == 0 ||
+ seldata.end == 0) {
+ /* ":[0..N]" or ":[N..0]" */
+ free(estr);
+ goto bad_modifier;
+ }
+ /*
+ * Normal case: select the words
+ * described by seldata.
+ */
+ newStr = VarSelectWords(ctxt, &parsestate,
+ nstr, &seldata);
+
+ termc = *cp;
+ free(estr);
+ break;
+ }
+
+ }
+ case 't':
+ {
+ cp = tstr + 1; /* make sure it is set */
+ if (tstr[1] != endc && tstr[1] != ':') {
+ if (tstr[1] == 's') {
+ /*
+ * Use the char (if any) at tstr[2]
+ * as the word separator.
+ */
+ VarPattern pattern;
+
+ if (tstr[2] != endc &&
+ (tstr[3] == endc || tstr[3] == ':')) {
+ /* ":ts<unrecognised><endc>" or
+ * ":ts<unrecognised>:" */
+ parsestate.varSpace = tstr[2];
+ cp = tstr + 3;
+ } else if (tstr[2] == endc || tstr[2] == ':') {
+ /* ":ts<endc>" or ":ts:" */
+ parsestate.varSpace = 0; /* no separator */
+ cp = tstr + 2;
+ } else if (tstr[2] == '\\') {
+ switch (tstr[3]) {
+ case 'n':
+ parsestate.varSpace = '\n';
+ cp = tstr + 4;
+ break;
+ case 't':
+ parsestate.varSpace = '\t';
+ cp = tstr + 4;
+ break;
+ default:
+ if (isdigit((unsigned char)tstr[3])) {
+ char *ep;
+
+ parsestate.varSpace =
+ strtoul(&tstr[3], &ep, 0);
+ if (*ep != ':' && *ep != endc)
+ goto bad_modifier;
+ cp = ep;
+ } else {
+ /*
+ * ":ts<backslash><unrecognised>".
+ */
+ goto bad_modifier;
+ }
+ break;
+ }
+ } else {
+ /*
+ * Found ":ts<unrecognised><unrecognised>".
+ */
+ goto bad_modifier;
+ }
+
+ termc = *cp;
+
+ /*
+ * We cannot be certain that VarModify
+ * will be used - even if there is a
+ * subsequent modifier, so do a no-op
+ * VarSubstitute now to for str to be
+ * re-expanded without the spaces.
+ */
+ pattern.flags = VAR_SUB_ONE;
+ pattern.lhs = pattern.rhs = "\032";
+ pattern.leftLen = pattern.rightLen = 1;
+
+ newStr = VarModify(ctxt, &parsestate, nstr,
+ VarSubstitute,
+ &pattern);
+ } else if (tstr[2] == endc || tstr[2] == ':') {
+ /*
+ * Check for two-character options:
+ * ":tu", ":tl"
+ */
+ if (tstr[1] == 'u' || tstr[1] == 'l') {
+ newStr = VarChangeCase(nstr, (tstr[1] == 'u'));
+ cp = tstr + 2;
+ termc = *cp;
+ } else if (tstr[1] == 'W' || tstr[1] == 'w') {
+ parsestate.oneBigWord = (tstr[1] == 'W');
+ newStr = nstr;
+ cp = tstr + 2;
+ termc = *cp;
+ } else {
+ /* Found ":t<unrecognised>:" or
+ * ":t<unrecognised><endc>". */
+ goto bad_modifier;
+ }
+ } else {
+ /*
+ * Found ":t<unrecognised><unrecognised>".
+ */
+ goto bad_modifier;
+ }
+ } else {
+ /*
+ * Found ":t<endc>" or ":t:".
+ */
+ goto bad_modifier;
+ }
+ break;
+ }
+ case 'N':
+ case 'M':
+ {
+ char *pattern;
+ const char *endpat; /* points just after end of pattern */
+ char *cp2;
+ Boolean copy; /* pattern should be, or has been, copied */
+ int nest;
+
+ copy = FALSE;
+ nest = 1;
+ /*
+ * In the loop below, ignore ':' unless we are at
+ * (or back to) the original brace level.
+ * XXX This will likely not work right if $() and ${}
+ * are intermixed.
+ */
+ for (cp = tstr + 1;
+ *cp != '\0' && !(*cp == ':' && nest == 1);
+ cp++)
+ {
+ if (*cp == '\\' &&
+ (cp[1] == ':' ||
+ cp[1] == endc || cp[1] == startc)) {
+ copy = TRUE;
+ cp++;
+ continue;
+ }
+ if (*cp == startc)
+ ++nest;
+ if (*cp == endc) {
+ --nest;
+ if (nest == 0)
+ break;
+ }
+ }
+ termc = *cp;
+ endpat = cp;
+ if (copy) {
+ /*
+ * Need to compress the \:'s out of the pattern, so
+ * allocate enough room to hold the uncompressed
+ * pattern (note that cp started at tstr+1, so
+ * cp - tstr takes the null byte into account) and
+ * compress the pattern into the space.
+ */
+ pattern = emalloc(cp - tstr);
+ for (cp2 = pattern, cp = tstr + 1;
+ cp < endpat;
+ cp++, cp2++)
+ {
+ if ((*cp == '\\') && (cp+1 < endpat) &&
+ (cp[1] == ':' || cp[1] == endc)) {
+ cp++;
+ }
+ *cp2 = *cp;
+ }
+ *cp2 = '\0';
+ endpat = cp2;
+ } else {
+ /*
+ * Either Var_Subst or VarModify will need a
+ * nul-terminated string soon, so construct one now.
+ */
+ pattern = estrndup(tstr+1, endpat - (tstr + 1));
+ copy = TRUE;
+ }
+ if (strchr(pattern, '$') != NULL) {
+ /*
+ * pattern contains embedded '$', so use Var_Subst to
+ * expand it.
+ */
+ cp2 = pattern;
+ pattern = Var_Subst(NULL, cp2, ctxt, errnum);
+ if (copy)
+ free(cp2);
+ copy = TRUE;
+ }
+ if (*tstr == 'M' || *tstr == 'm') {
+ newStr = VarModify(ctxt, &parsestate, nstr, VarMatch,
+ pattern);
+ } else {
+ newStr = VarModify(ctxt, &parsestate, nstr, VarNoMatch,
+ pattern);
+ }
+ if (copy) {
+ free(pattern);
+ }
+ break;
+ }
+ case 'S':
+ {
+ VarPattern pattern;
+ Var_Parse_State tmpparsestate;
+
+ pattern.flags = 0;
+ tmpparsestate = parsestate;
+ delim = tstr[1];
+ tstr += 2;
+
+ /*
+ * If pattern begins with '^', it is anchored to the
+ * start of the word -- skip over it and flag pattern.
+ */
+ if (*tstr == '^') {
+ pattern.flags |= VAR_MATCH_START;
+ tstr += 1;
+ }
+
+ cp = tstr;
+ if ((pattern.lhs = VarGetPattern(ctxt, &parsestate, errnum,
+ &cp, delim,
+ &pattern.flags,
+ &pattern.leftLen,
+ NULL)) == NULL)
+ goto cleanup;
+
+ if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, errnum,
+ &cp, delim, NULL,
+ &pattern.rightLen,
+ &pattern)) == NULL)
+ goto cleanup;
+
+ /*
+ * Check for global substitution. If 'g' after the final
+ * delimiter, substitution is global and is marked that
+ * way.
+ */
+ for (;; cp++) {
+ switch (*cp) {
+ case 'g':
+ pattern.flags |= VAR_SUB_GLOBAL;
+ continue;
+ case '1':
+ pattern.flags |= VAR_SUB_ONE;
+ continue;
+ case 'W':
+ tmpparsestate.oneBigWord = TRUE;
+ continue;
+ }
+ break;
+ }
+
+ termc = *cp;
+ newStr = VarModify(ctxt, &tmpparsestate, nstr,
+ VarSubstitute,
+ &pattern);
+
+ /*
+ * Free the two strings.
+ */
+ free(UNCONST(pattern.lhs));
+ free(UNCONST(pattern.rhs));
+ delim = '\0';
+ break;
+ }
+ case '?':
+ {
+ VarPattern pattern;
+ Boolean value;
+
+ /* find ':', and then substitute accordingly */
+
+ pattern.flags = 0;
+
+ cp = ++tstr;
+ delim = ':';
+ if ((pattern.lhs = VarGetPattern(ctxt, &parsestate, errnum,
+ &cp, delim, NULL,
+ &pattern.leftLen,
+ NULL)) == NULL)
+ goto cleanup;
+
+ /* BROPEN or PROPEN */
+ delim = endc;
+ if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, errnum,
+ &cp, delim, NULL,
+ &pattern.rightLen,
+ NULL)) == NULL)
+ goto cleanup;
+
+ termc = *--cp;
+ delim = '\0';
+ if (Cond_EvalExpression(1, v->name, &value, 0)
+ == COND_INVALID) {
+ Error("Bad conditional expression `%s' in %s?%s:%s",
+ v->name, v->name, pattern.lhs, pattern.rhs);
+ goto cleanup;
+ }
+
+ if (value) {
+ newStr = UNCONST(pattern.lhs);
+ free(UNCONST(pattern.rhs));
+ } else {
+ newStr = UNCONST(pattern.rhs);
+ free(UNCONST(pattern.lhs));
+ }
+ if (v->flags & VAR_JUNK) {
+ v->flags |= VAR_KEEP;
+ }
+ break;
+ }
+#ifndef NO_REGEX
+ case 'C':
+ {
+ VarREPattern pattern;
+ char *re;
+ int error;
+ Var_Parse_State tmpparsestate;
+
+ pattern.flags = 0;
+ tmpparsestate = parsestate;
+ delim = tstr[1];
+ tstr += 2;
+
+ cp = tstr;
+
+ if ((re = VarGetPattern(ctxt, &parsestate, errnum, &cp, delim,
+ NULL, NULL, NULL)) == NULL)
+ goto cleanup;
+
+ if ((pattern.replace = VarGetPattern(ctxt, &parsestate,
+ errnum, &cp, delim, NULL,
+ NULL, NULL)) == NULL){
+ free(re);
+ goto cleanup;
+ }
+
+ for (;; cp++) {
+ switch (*cp) {
+ case 'g':
+ pattern.flags |= VAR_SUB_GLOBAL;
+ continue;
+ case '1':
+ pattern.flags |= VAR_SUB_ONE;
+ continue;
+ case 'W':
+ tmpparsestate.oneBigWord = TRUE;
+ continue;
+ }
+ break;
+ }
+
+ termc = *cp;
+
+ error = regcomp(&pattern.re, re, REG_EXTENDED);
+ free(re);
+ if (error) {
+ *lengthPtr = cp - start + 1;
+ VarREError(error, &pattern.re, "RE substitution error");
+ free(pattern.replace);
+ goto cleanup;
+ }
+
+ pattern.nsub = pattern.re.re_nsub + 1;
+ if (pattern.nsub < 1)
+ pattern.nsub = 1;
+ if (pattern.nsub > 10)
+ pattern.nsub = 10;
+ pattern.matches = emalloc(pattern.nsub *
+ sizeof(regmatch_t));
+ newStr = VarModify(ctxt, &tmpparsestate, nstr,
+ VarRESubstitute,
+ &pattern);
+ regfree(&pattern.re);
+ free(pattern.replace);
+ free(pattern.matches);
+ delim = '\0';
+ break;
+ }
+#endif
+ case 'Q':
+ if (tstr[1] == endc || tstr[1] == ':') {
+ newStr = VarQuote(nstr);
+ cp = tstr + 1;
+ termc = *cp;
+ break;
+ }
+ goto default_case;
+ case 'T':
+ if (tstr[1] == endc || tstr[1] == ':') {
+ newStr = VarModify(ctxt, &parsestate, nstr, VarTail,
+ NULL);
+ cp = tstr + 1;
+ termc = *cp;
+ break;
+ }
+ goto default_case;
+ case 'H':
+ if (tstr[1] == endc || tstr[1] == ':') {
+ newStr = VarModify(ctxt, &parsestate, nstr, VarHead,
+ NULL);
+ cp = tstr + 1;
+ termc = *cp;
+ break;
+ }
+ goto default_case;
+ case 'E':
+ if (tstr[1] == endc || tstr[1] == ':') {
+ newStr = VarModify(ctxt, &parsestate, nstr, VarSuffix,
+ NULL);
+ cp = tstr + 1;
+ termc = *cp;
+ break;
+ }
+ goto default_case;
+ case 'R':
+ if (tstr[1] == endc || tstr[1] == ':') {
+ newStr = VarModify(ctxt, &parsestate, nstr, VarRoot,
+ NULL);
+ cp = tstr + 1;
+ termc = *cp;
+ break;
+ }
+ goto default_case;
+ case 'O':
+ {
+ char otype;
+
+ cp = tstr + 1; /* skip to the rest in any case */
+ if (tstr[1] == endc || tstr[1] == ':') {
+ otype = 's';
+ termc = *cp;
+ } else if ( (tstr[1] == 'x') &&
+ (tstr[2] == endc || tstr[2] == ':') ) {
+ otype = tstr[1];
+ cp = tstr + 2;
+ termc = *cp;
+ } else {
+ goto bad_modifier;
+ }
+ newStr = VarOrder(nstr, otype);
+ break;
+ }
+ case 'u':
+ if (tstr[1] == endc || tstr[1] == ':') {
+ newStr = VarUniq(nstr);
+ cp = tstr + 1;
+ termc = *cp;
+ break;
+ }
+ goto default_case;
+#ifdef SUNSHCMD
+ case 's':
+ if (tstr[1] == 'h' && (tstr[2] == endc || tstr[2] == ':')) {
+ const char *emsg;
+ newStr = Cmd_Exec(nstr, &emsg);
+ if (emsg)
+ Error(emsg, nstr);
+ cp = tstr + 2;
+ termc = *cp;
+ break;
+ }
+ goto default_case;
+#endif
+ default:
+ default_case:
+ {
+#ifdef SYSVVARSUB
+ /*
+ * This can either be a bogus modifier or a System-V
+ * substitution command.
+ */
+ VarPattern pattern;
+ Boolean eqFound;
+
+ pattern.flags = 0;
+ eqFound = FALSE;
+ /*
+ * First we make a pass through the string trying
+ * to verify it is a SYSV-make-style translation:
+ * it must be: <string1>=<string2>)
+ */
+ cp = tstr;
+ cnt = 1;
+ while (*cp != '\0' && cnt) {
+ if (*cp == '=') {
+ eqFound = TRUE;
+ /* continue looking for endc */
+ }
+ else if (*cp == endc)
+ cnt--;
+ else if (*cp == startc)
+ cnt++;
+ if (cnt)
+ cp++;
+ }
+ if (*cp == endc && eqFound) {
+
+ /*
+ * Now we break this sucker into the lhs and
+ * rhs. We must null terminate them of course.
+ */
+ delim='=';
+ cp = tstr;
+ if ((pattern.lhs = VarGetPattern(ctxt, &parsestate,
+ errnum, &cp, delim, &pattern.flags,
+ &pattern.leftLen, NULL)) == NULL)
+ goto cleanup;
+ delim = endc;
+ if ((pattern.rhs = VarGetPattern(ctxt, &parsestate,
+ errnum, &cp, delim, NULL, &pattern.rightLen,
+ &pattern)) == NULL)
+ goto cleanup;
+
+ /*
+ * SYSV modifications happen through the whole
+ * string. Note the pattern is anchored at the end.
+ */
+ termc = *--cp;
+ delim = '\0';
+ newStr = VarModify(ctxt, &parsestate, nstr,
+ VarSYSVMatch,
+ &pattern);
+ free(UNCONST(pattern.lhs));
+ free(UNCONST(pattern.rhs));
+ } else
+#endif
+ {
+ Error("Unknown modifier '%c'", *tstr);
+ for (cp = tstr+1;
+ *cp != ':' && *cp != endc && *cp != '\0';
+ cp++)
+ continue;
+ termc = *cp;
+ newStr = var_Error;
+ }
+ }
+ }
+ if (DEBUG(VAR)) {
+ fprintf(debug_file, "Result of :%c is \"%s\"\n", modifier, newStr);
+ }
+
+ if (newStr != nstr) {
+ if (*freePtr) {
+ free(nstr);
+ *freePtr = NULL;
+ }
+ nstr = newStr;
+ if (nstr != var_Error && nstr != varNoError) {
+ *freePtr = nstr;
+ }
+ }
+ if (termc == '\0' && endc != '\0') {
+ Error("Unclosed variable specification for %s", v->name);
+ } else if (termc == ':') {
+ cp++;
+ }
+ tstr = cp;
+ }
+ out:
+ *lengthPtr = tstr - start;
+ return (nstr);
+
+ bad_modifier:
+ /* "{(" */
+ Error("Bad modifier `:%.*s' for %s", (int)strcspn(tstr, ":)}"), tstr,
+ v->name);
+
+ cleanup:
+ *lengthPtr = cp - start;
+ if (delim != '\0')
+ Error("Unclosed substitution for %s (%c missing)",
+ v->name, delim);
+ if (*freePtr) {
+ free(*freePtr);
+ *freePtr = NULL;
+ }
+ return (var_Error);
+}
+
/*-
*-----------------------------------------------------------------------
* Var_Parse --
@@ -1877,49 +3196,45 @@ VarChangeCase(char *str, int upper)
* Input:
* str The string to parse
* ctxt The context for the variable
- * err TRUE if undefined variables are an error
+ * errnum TRUE if undefined variables are an error
* lengthPtr OUT: The length of the specification
- * freePtr OUT: TRUE if caller should free result
+ * freePtr OUT: Non-NULL if caller should free *freePtr
*
* Results:
* The (possibly-modified) value of the variable or var_Error if the
* specification is invalid. The length of the specification is
* placed in *lengthPtr (for invalid specifications, this is just
* 2...?).
- * A Boolean in *freePtr telling whether the returned string should
- * be freed by the caller.
+ * If *freePtr is non-NULL then it's a pointer that the caller
+ * should pass to free() to free memory used by the result.
*
* Side Effects:
* None.
*
*-----------------------------------------------------------------------
*/
+/* coverity[+alloc : arg-*4] */
char *
-Var_Parse(const char *str, GNode *ctxt, Boolean err, int *lengthPtr,
- Boolean *freePtr)
+Var_Parse(const char *str, GNode *ctxt, Boolean errnum, int *lengthPtr,
+ void **freePtr)
{
const char *tstr; /* Pointer into str */
Var *v; /* Variable in invocation */
- const char *cp; /* Secondary pointer into str (place marker
- * for tstr) */
Boolean haveModifier;/* TRUE if have modifiers for the variable */
char endc; /* Ending character when variable in parens
* or braces */
char startc=0; /* Starting character when variable in parens
* or braces */
- int cnt; /* Used to count brace pairs when variable in
- * in parens or braces */
int vlen; /* Length of variable name */
- const char *start;
- char delim;
- char *nstr;
+ const char *start; /* Points to original start of str */
+ char *nstr; /* New string, used during expansion */
Boolean dynamic; /* TRUE if the variable is local and we're
* expanding it in a non-local context. This
* is done to support dynamic sources. The
* result is just the invocation, unaltered */
Var_Parse_State parsestate; /* Flags passed to helper functions */
- *freePtr = FALSE;
+ *freePtr = NULL;
dynamic = FALSE;
start = str;
parsestate.oneBigWord = FALSE;
@@ -1964,7 +3279,7 @@ Var_Parse(const char *str, GNode *ctxt, Boolean err, int *lengthPtr,
/*
* Error
*/
- return (err ? var_Error : varNoError);
+ return (errnum ? var_Error : varNoError);
} else {
haveModifier = FALSE;
tstr = &str[1];
@@ -1972,13 +3287,13 @@ Var_Parse(const char *str, GNode *ctxt, Boolean err, int *lengthPtr,
}
} else if (str[1] == '\0') {
*lengthPtr = 1;
- return (err ? var_Error : varNoError);
- } else {
+ return (errnum ? var_Error : varNoError);
+ } else {
Buffer buf; /* Holds the variable name */
startc = str[1];
endc = startc == PROPEN ? PRCLOSE : BRCLOSE;
- buf = Buf_Init(MAKE_BSIZE);
+ buf = Buf_Init(0);
/*
* Skip to the end character or a colon, whichever comes first.
@@ -1992,13 +3307,13 @@ Var_Parse(const char *str, GNode *ctxt, Boolean err, int *lengthPtr,
*/
if (*tstr == '$') {
int rlen;
- Boolean rfree;
- char *rval = Var_Parse(tstr, ctxt, err, &rlen, &rfree);
+ void *freeIt;
+ char *rval = Var_Parse(tstr, ctxt, errnum, &rlen, &freeIt);
if (rval != NULL) {
Buf_AddBytes(buf, strlen(rval), (Byte *)rval);
- if (rfree)
- free(rval);
}
+ if (freeIt)
+ free(freeIt);
tstr += rlen - 1;
}
else
@@ -2015,13 +3330,24 @@ Var_Parse(const char *str, GNode *ctxt, Boolean err, int *lengthPtr,
* the end of the string, since that's what make does.
*/
*lengthPtr = tstr - str;
+ Buf_Destroy(buf, TRUE);
return (var_Error);
}
- *WR(tstr) = '\0';
Buf_AddByte(buf, (Byte)'\0');
str = Buf_GetAll(buf, NULL);
vlen = strlen(str);
+ /*
+ * At this point, str points into newly allocated memory from
+ * buf, containing only the name of the variable.
+ *
+ * start and tstr point into the const string that was pointed
+ * to by the original value of the str parameter. start points
+ * to the '$' at the beginning of the string, while tstr points
+ * to the char just after the end of the variable name -- this
+ * will be '\0', ':', PRCLOSE, or BRCLOSE.
+ */
+
v = VarFind(str, ctxt, FIND_ENV | FIND_GLOBAL | FIND_CMD);
if ((v == (Var *)NIL) && (ctxt != VAR_CMD) && (ctxt != VAR_GLOBAL) &&
(vlen == 2) && (str[1] == 'F' || str[1] == 'D'))
@@ -2058,19 +3384,19 @@ Var_Parse(const char *str, GNode *ctxt, Boolean err, int *lengthPtr,
if (str[1] == 'D') {
val = VarModify(ctxt, &parsestate, val, VarHead,
- (ClientData)0);
+ NULL);
} else {
val = VarModify(ctxt, &parsestate, val, VarTail,
- (ClientData)0);
+ NULL);
}
/*
* Resulting string is dynamically allocated, so
* tell caller to free it.
*/
- *freePtr = TRUE;
+ *freePtr = val;
*lengthPtr = tstr-start+1;
- *WR(tstr) = endc;
Buf_Destroy(buf, TRUE);
+ VarFreeEnv(v, TRUE);
return(val);
}
break;
@@ -2123,17 +3449,14 @@ Var_Parse(const char *str, GNode *ctxt, Boolean err, int *lengthPtr,
* now.
*/
*lengthPtr = tstr - start + 1;
- *WR(tstr) = endc;
if (dynamic) {
- char *pstr = emalloc(*lengthPtr + 1);
- strncpy(pstr, start, *lengthPtr);
- pstr[*lengthPtr] = '\0';
- *freePtr = TRUE;
+ char *pstr = estrndup(start, *lengthPtr);
+ *freePtr = pstr;
Buf_Destroy(buf, TRUE);
return(pstr);
} else {
Buf_Destroy(buf, TRUE);
- return (err ? var_Error : varNoError);
+ return (errnum ? var_Error : varNoError);
}
} else {
/*
@@ -2150,7 +3473,6 @@ Var_Parse(const char *str, GNode *ctxt, Boolean err, int *lengthPtr,
Buf_Destroy(buf, TRUE);
}
-
if (v->flags & VAR_IN_USE) {
Fatal("Variable %s is recursive.", v->name);
/*NOTREACHED*/
@@ -2168,1028 +3490,27 @@ Var_Parse(const char *str, GNode *ctxt, Boolean err, int *lengthPtr,
*/
nstr = (char *)Buf_GetAll(v->val, NULL);
if (strchr(nstr, '$') != NULL) {
- nstr = Var_Subst(NULL, nstr, ctxt, err);
- *freePtr = TRUE;
+ nstr = Var_Subst(NULL, nstr, ctxt, errnum);
+ *freePtr = nstr;
}
v->flags &= ~VAR_IN_USE;
- /*
- * Now we need to apply any modifiers the user wants applied.
- * These are:
- * :M<pattern> words which match the given <pattern>.
- * <pattern> is of the standard file
- * wildcarding form.
- * :N<pattern> words which do not match the given <pattern>.
- * :S<d><pat1><d><pat2><d>[1gW]
- * Substitute <pat2> for <pat1> in the value
- * :C<d><pat1><d><pat2><d>[1gW]
- * Substitute <pat2> for regex <pat1> in the value
- * :H Substitute the head of each word
- * :T Substitute the tail of each word
- * :E Substitute the extension (minus '.') of
- * each word
- * :R Substitute the root of each word
- * (pathname minus the suffix).
- * :O ("Order") Alphabeticaly sort words in variable.
- * :Ox ("intermiX") Randomize words in variable.
- * :u ("uniq") Remove adjacent duplicate words.
- * :tu Converts the variable contents to uppercase.
- * :tl Converts the variable contents to lowercase.
- * :ts[c] Sets varSpace - the char used to
- * separate words to 'c'. If 'c' is
- * omitted then no separation is used.
- * :tW Treat the variable contents as a single
- * word, even if it contains spaces.
- * (Mnemonic: one big 'W'ord.)
- * :tw Treat the variable contents as multiple
- * space-separated words.
- * (Mnemonic: many small 'w'ords.)
- * :[index] Select a single word from the value.
- * :[start..end] Select multiple words from the value.
- * :[*] or :[0] Select the entire value, as a single
- * word. Equivalent to :tW.
- * :[@] Select the entire value, as multiple
- * words. Undoes the effect of :[*].
- * Equivalent to :tw.
- * :[#] Returns the number of words in the value.
- *
- * :?<true-value>:<false-value>
- * If the variable evaluates to true, return
- * true value, else return the second value.
- * :lhs=rhs Like :S, but the rhs goes to the end of
- * the invocation.
- * :sh Treat the current value as a command
- * to be run, new value is its output.
- * The following added so we can handle ODE makefiles.
- * :@<tmpvar>@<newval>@
- * Assign a temporary local variable <tmpvar>
- * to the current value of each word in turn
- * and replace each word with the result of
- * evaluating <newval>
- * :D<newval> Use <newval> as value if variable defined
- * :U<newval> Use <newval> as value if variable undefined
- * :L Use the name of the variable as the value.
- * :P Use the path of the node that has the same
- * name as the variable as the value. This
- * basically includes an implied :L so that
- * the common method of refering to the path
- * of your dependent 'x' in a rule is to use
- * the form '${x:P}'.
- * :!<cmd>! Run cmd much the same as :sh run's the
- * current value of the variable.
- * The ::= modifiers, actually assign a value to the variable.
- * Their main purpose is in supporting modifiers of .for loop
- * iterators and other obscure uses. They always expand to
- * nothing. In a target rule that would otherwise expand to an
- * empty line they can be preceded with @: to keep make happy.
- * Eg.
- *
- * foo: .USE
- * .for i in ${.TARGET} ${.TARGET:R}.gz
- * @: ${t::=$i}
- * @echo blah ${t:T}
- * .endfor
- *
- * ::=<str> Assigns <str> as the new value of variable.
- * ::?=<str> Assigns <str> as value of variable if
- * it was not already set.
- * ::+=<str> Appends <str> to variable.
- * ::!=<cmd> Assigns output of <cmd> as the new value of
- * variable.
- */
if ((nstr != NULL) && haveModifier) {
+ int used;
/*
- * Skip initial colon while putting it back.
+ * Skip initial colon.
*/
- *WR(tstr) = ':';
tstr++;
- delim = '\0';
-
- while (*tstr && *tstr != endc) {
- char *newStr; /* New value to return */
- char termc; /* Character which terminated scan */
- if (DEBUG(VAR)) {
- printf("Applying :%c to \"%s\"\n", *tstr, nstr);
- }
- newStr = var_Error;
- switch (*tstr) {
- case ':':
- {
- if (tstr[1] == '=' ||
- (tstr[2] == '=' &&
- (tstr[1] == '!' || tstr[1] == '+' || tstr[1] == '?'))) {
- /*
- * "::=", "::!=", "::+=", or "::?="
- */
- GNode *v_ctxt; /* context where v belongs */
- const char *emsg;
- char *sv_name;
- VarPattern pattern;
- int how;
-
- v_ctxt = ctxt;
- sv_name = NULL;
- ++tstr;
- if (v->flags & VAR_JUNK) {
- /*
- * We need to strdup() it incase
- * VarGetPattern() recurses.
- */
- sv_name = v->name;
- v->name = strdup(v->name);
- } else if (ctxt != VAR_GLOBAL) {
- if (VarFind(v->name, ctxt, 0) == (Var *)NIL)
- v_ctxt = VAR_GLOBAL;
- }
-
- switch ((how = *tstr)) {
- case '+':
- case '?':
- case '!':
- cp = &tstr[2];
- break;
- default:
- cp = ++tstr;
- break;
- }
- delim = BRCLOSE;
- pattern.flags = 0;
-
- pattern.rhs = VarGetPattern(ctxt, &parsestate, err,
- &cp, delim, NULL,
- &pattern.rightLen,
- NULL);
- if (v->flags & VAR_JUNK) {
- /* restore original name */
- free(v->name);
- v->name = sv_name;
- }
- if (pattern.rhs == NULL)
- goto cleanup;
-
- termc = *--cp;
- delim = '\0';
-
- switch (how) {
- case '+':
- Var_Append(v->name, pattern.rhs, v_ctxt);
- break;
- case '!':
- newStr = Cmd_Exec(pattern.rhs, &emsg);
- if (emsg)
- Error(emsg, nstr);
- else
- Var_Set(v->name, newStr, v_ctxt, 0);
- if (newStr)
- free(newStr);
- break;
- case '?':
- if ((v->flags & VAR_JUNK) == 0)
- break;
- /* FALLTHROUGH */
- default:
- Var_Set(v->name, pattern.rhs, v_ctxt, 0);
- break;
- }
- free(UNCONST(pattern.rhs));
- newStr = var_Error;
- break;
- }
- goto default_case; /* "::<unrecognised>" */
- }
- case '@':
- {
- VarLoop_t loop;
- int flags = VAR_NOSUBST;
-
- cp = ++tstr;
- delim = '@';
- if ((loop.tvar = VarGetPattern(ctxt, &parsestate, err,
- &cp, delim,
- &flags, &loop.tvarLen,
- NULL)) == NULL)
- goto cleanup;
-
- if ((loop.str = VarGetPattern(ctxt, &parsestate, err,
- &cp, delim,
- &flags, &loop.strLen,
- NULL)) == NULL)
- goto cleanup;
-
- termc = *cp;
- delim = '\0';
-
- loop.err = err;
- loop.ctxt = ctxt;
- newStr = VarModify(ctxt, &parsestate, nstr, VarLoopExpand,
- (ClientData)&loop);
- free(loop.tvar);
- free(loop.str);
- break;
- }
- case 'D':
- case 'U':
- {
- Buffer buf; /* Buffer for patterns */
- int wantit; /* want data in buffer */
-
- /*
- * Pass through tstr looking for 1) escaped delimiters,
- * '$'s and backslashes (place the escaped character in
- * uninterpreted) and 2) unescaped $'s that aren't before
- * the delimiter (expand the variable substitution).
- * The result is left in the Buffer buf.
- */
- buf = Buf_Init(0);
- for (cp = tstr + 1;
- *cp != endc && *cp != ':' && *cp != '\0';
- cp++) {
- if ((*cp == '\\') &&
- ((cp[1] == ':') ||
- (cp[1] == '$') ||
- (cp[1] == endc) ||
- (cp[1] == '\\')))
- {
- Buf_AddByte(buf, (Byte)cp[1]);
- cp++;
- } else if (*cp == '$') {
- /*
- * If unescaped dollar sign, assume it's a
- * variable substitution and recurse.
- */
- char *cp2;
- int len;
- Boolean freeIt;
-
- cp2 = Var_Parse(cp, ctxt, err, &len, &freeIt);
- Buf_AddBytes(buf, strlen(cp2), (Byte *)cp2);
- if (freeIt)
- free(cp2);
- cp += len - 1;
- } else {
- Buf_AddByte(buf, (Byte)*cp);
- }
- }
- Buf_AddByte(buf, (Byte)'\0');
-
- termc = *cp;
-
- if (*tstr == 'U')
- wantit = ((v->flags & VAR_JUNK) != 0);
- else
- wantit = ((v->flags & VAR_JUNK) == 0);
- if ((v->flags & VAR_JUNK) != 0)
- v->flags |= VAR_KEEP;
- if (wantit) {
- newStr = (char *)Buf_GetAll(buf, NULL);
- Buf_Destroy(buf, FALSE);
- } else {
- newStr = nstr;
- Buf_Destroy(buf, TRUE);
- }
- break;
- }
- case 'L':
- {
- if ((v->flags & VAR_JUNK) != 0)
- v->flags |= VAR_KEEP;
- newStr = strdup(v->name);
- cp = ++tstr;
- termc = *tstr;
- break;
- }
- case 'P':
- {
- GNode *gn;
-
- if ((v->flags & VAR_JUNK) != 0)
- v->flags |= VAR_KEEP;
- gn = Targ_FindNode(v->name, TARG_NOCREATE);
- if (gn == NILGNODE || gn->path == NULL)
- newStr = strdup(v->name);
- else
- newStr = strdup(gn->path);
- cp = ++tstr;
- termc = *tstr;
- break;
- }
- case '!':
- {
- const char *emsg;
- VarPattern pattern;
- pattern.flags = 0;
-
- delim = '!';
-
- cp = ++tstr;
- if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, err,
- &cp, delim,
- NULL, &pattern.rightLen,
- NULL)) == NULL)
- goto cleanup;
- newStr = Cmd_Exec(pattern.rhs, &emsg);
- free(UNCONST(pattern.rhs));
- if (emsg)
- Error(emsg, nstr);
- termc = *cp;
- delim = '\0';
- if (v->flags & VAR_JUNK) {
- v->flags |= VAR_KEEP;
- }
- break;
- }
- case '[':
- {
- /*
- * Look for the closing ']', recursively
- * expanding any embedded variables.
- *
- * estr is a pointer to the expanded result,
- * which we must free().
- */
- char *estr;
-
- cp = tstr+1; /* point to char after '[' */
- delim = ']'; /* look for closing ']' */
- estr = VarGetPattern(ctxt, &parsestate,
- err, &cp, delim,
- NULL, NULL, NULL);
- if (estr == NULL)
- goto cleanup; /* report missing ']' */
- /* now cp points just after the closing ']' */
- delim = '\0';
- if (cp[0] != ':' && cp[0] != endc) {
- /* Found junk after ']' */
- free(estr);
- goto bad_modifier;
- }
- if (estr[0] == '\0') {
- /* Found empty square brackets in ":[]". */
- free(estr);
- goto bad_modifier;
- } else if (estr[0] == '#' && estr[1] == '\0') {
- /* Found ":[#]" */
-
- /*
- * We will need enough space for the decimal
- * representation of an int. We calculate the
- * space needed for the octal representation,
- * and add enough slop to cope with a '-' sign
- * (which should never be needed) and a '\0'
- * string terminator.
- */
- int newStrSize =
- (sizeof(int) * CHAR_BIT + 2) / 3 + 2;
-
- newStr = emalloc(newStrSize);
- if (parsestate.oneBigWord) {
- strncpy(newStr, "1", newStrSize);
- } else {
- /* XXX: brk_string() is a rather expensive
- * way of counting words. */
- char **av;
- char *as;
- int ac;
-
- av = brk_string(nstr, &ac, FALSE, &as);
- snprintf(newStr, newStrSize, "%d", ac);
- free(as);
- free(av);
- }
- termc = *cp;
- free(estr);
- break;
- } else if (estr[0] == '*' && estr[1] == '\0') {
- /* Found ":[*]" */
- parsestate.oneBigWord = TRUE;
- newStr = nstr;
- termc = *cp;
- free(estr);
- break;
- } else if (estr[0] == '@' && estr[1] == '\0') {
- /* Found ":[@]" */
- parsestate.oneBigWord = FALSE;
- newStr = nstr;
- termc = *cp;
- free(estr);
- break;
- } else {
- /*
- * We expect estr to contain a single
- * integer for :[N], or two integers
- * separated by ".." for :[start..end].
- */
- char *ep;
-
- VarSelectWords_t seldata = { 0, 0 };
-
- seldata.start = strtol(estr, &ep, 0);
- if (ep == estr) {
- /* Found junk instead of a number */
- free(estr);
- goto bad_modifier;
- } else if (ep[0] == '\0') {
- /* Found only one integer in :[N] */
- seldata.end = seldata.start;
- } else if (ep[0] == '.' && ep[1] == '.' &&
- ep[2] != '\0') {
- /* Expecting another integer after ".." */
- ep += 2;
- seldata.end = strtol(ep, &ep, 0);
- if (ep[0] != '\0') {
- /* Found junk after ".." */
- free(estr);
- goto bad_modifier;
- }
- } else {
- /* Found junk instead of ".." */
- free(estr);
- goto bad_modifier;
- }
- /*
- * Now seldata is properly filled in,
- * but we still have to check for 0 as
- * a special case.
- */
- if (seldata.start == 0 && seldata.end == 0) {
- /* ":[0]" or perhaps ":[0..0]" */
- parsestate.oneBigWord = TRUE;
- newStr = nstr;
- termc = *cp;
- free(estr);
- break;
- } else if (seldata.start == 0 ||
- seldata.end == 0) {
- /* ":[0..N]" or ":[N..0]" */
- free(estr);
- goto bad_modifier;
- }
- /*
- * Normal case: select the words
- * described by seldata.
- */
- newStr = VarSelectWords(ctxt, &parsestate,
- nstr, &seldata);
-
- termc = *cp;
- free(estr);
- break;
- }
-
- }
- case 't':
- {
- cp = tstr + 1; /* make sure it is set */
- if (tstr[1] != endc && tstr[1] != ':') {
- if (tstr[1] == 's') {
- /*
- * Use the char (if any) at tstr[2]
- * as the word separator.
- */
- VarPattern pattern;
-
- if (tstr[2] != endc &&
- (tstr[3] == endc || tstr[3] == ':')) {
- /* ":ts<unrecognised><endc>" or
- * ":ts<unrecognised>:" */
- parsestate.varSpace = tstr[2];
- cp = tstr + 3;
- } else if (tstr[2] == endc || tstr[2] == ':') {
- /* ":ts<endc>" or ":ts:" */
- parsestate.varSpace = 0; /* no separator */
- cp = tstr + 2;
- } else if (tstr[2] == '\\') {
- switch (tstr[3]) {
- case 'n':
- parsestate.varSpace = '\n';
- cp = tstr + 4;
- break;
- case 't':
- parsestate.varSpace = '\t';
- cp = tstr + 4;
- break;
- default:
- if (isdigit((unsigned char)tstr[3])) {
- char *ep;
-
- parsestate.varSpace =
- strtoul(&tstr[3], &ep, 0);
- if (*ep != ':' && *ep != endc)
- goto bad_modifier;
- cp = ep;
- } else {
- /*
- * ":ts<backslash><unrecognised>".
- */
- goto bad_modifier;
- }
- break;
- }
- } else {
- /*
- * Found ":ts<unrecognised><unrecognised>".
- */
- goto bad_modifier;
- }
-
- termc = *cp;
-
- /*
- * We cannot be certain that VarModify
- * will be used - even if there is a
- * subsequent modifier, so do a no-op
- * VarSubstitute now to for str to be
- * re-expanded without the spaces.
- */
- pattern.flags = VAR_SUB_ONE;
- pattern.lhs = pattern.rhs = "\032";
- pattern.leftLen = pattern.rightLen = 1;
-
- newStr = VarModify(ctxt, &parsestate, nstr,
- VarSubstitute,
- (ClientData)&pattern);
- } else if (tstr[2] == endc || tstr[2] == ':') {
- /*
- * Check for two-character options:
- * ":tu", ":tl"
- */
- if (tstr[1] == 'u' || tstr[1] == 'l') {
- newStr = VarChangeCase(nstr, (tstr[1] == 'u'));
- cp = tstr + 2;
- termc = *cp;
- } else if (tstr[1] == 'W' || tstr[1] == 'w') {
- parsestate.oneBigWord = (tstr[1] == 'W');
- newStr = nstr;
- cp = tstr + 2;
- termc = *cp;
- } else {
- /* Found ":t<unrecognised>:" or
- * ":t<unrecognised><endc>". */
- goto bad_modifier;
- }
- } else {
- /*
- * Found ":t<unrecognised><unrecognised>".
- */
- goto bad_modifier;
- }
- } else {
- /*
- * Found ":t<endc>" or ":t:".
- */
- goto bad_modifier;
- }
- break;
- }
- case 'N':
- case 'M':
- {
- char *pattern;
- char *cp2;
- Boolean copy;
- int nest;
-
- copy = FALSE;
- nest = 1;
- /*
- * In the loop below, ignore ':' unless we are at
- * (or back to) the original brace level.
- * XXX This will likely not work right if $() and ${}
- * are intermixed.
- */
- for (cp = tstr + 1;
- *cp != '\0' && !(*cp == ':' && nest == 1);
- cp++)
- {
- if (*cp == '\\' &&
- (cp[1] == ':' ||
- cp[1] == endc || cp[1] == startc)) {
- copy = TRUE;
- cp++;
- continue;
- }
- if (*cp == startc)
- ++nest;
- if (*cp == endc) {
- --nest;
- if (nest == 0)
- break;
- }
- }
- termc = *cp;
- *WR(cp) = '\0';
- if (copy) {
- /*
- * Need to compress the \:'s out of the pattern, so
- * allocate enough room to hold the uncompressed
- * pattern (note that cp started at tstr+1, so
- * cp - tstr takes the null byte into account) and
- * compress the pattern into the space.
- */
- pattern = emalloc(cp - tstr);
- for (cp2 = pattern, cp = tstr + 1;
- *cp != '\0';
- cp++, cp2++)
- {
- if ((*cp == '\\') &&
- (cp[1] == ':' || cp[1] == endc)) {
- cp++;
- }
- *cp2 = *cp;
- }
- *cp2 = '\0';
- } else {
- pattern = UNCONST(&tstr[1]);
- }
- if ((cp2 = strchr(pattern, '$'))) {
- cp2 = pattern;
- pattern = Var_Subst(NULL, cp2, ctxt, err);
- if (copy)
- free(cp2);
- copy = TRUE;
- }
- if (*tstr == 'M' || *tstr == 'm') {
- newStr = VarModify(ctxt, &parsestate, nstr, VarMatch,
- (ClientData)pattern);
- } else {
- newStr = VarModify(ctxt, &parsestate, nstr, VarNoMatch,
- (ClientData)pattern);
- }
- if (copy) {
- free(pattern);
- }
- break;
- }
- case 'S':
- {
- VarPattern pattern;
- Var_Parse_State tmpparsestate;
-
- pattern.flags = 0;
- tmpparsestate = parsestate;
- delim = tstr[1];
- tstr += 2;
-
- /*
- * If pattern begins with '^', it is anchored to the
- * start of the word -- skip over it and flag pattern.
- */
- if (*tstr == '^') {
- pattern.flags |= VAR_MATCH_START;
- tstr += 1;
- }
-
- cp = tstr;
- if ((pattern.lhs = VarGetPattern(ctxt, &parsestate, err,
- &cp, delim,
- &pattern.flags,
- &pattern.leftLen,
- NULL)) == NULL)
- goto cleanup;
-
- if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, err,
- &cp, delim, NULL,
- &pattern.rightLen,
- &pattern)) == NULL)
- goto cleanup;
-
- /*
- * Check for global substitution. If 'g' after the final
- * delimiter, substitution is global and is marked that
- * way.
- */
- for (;; cp++) {
- switch (*cp) {
- case 'g':
- pattern.flags |= VAR_SUB_GLOBAL;
- continue;
- case '1':
- pattern.flags |= VAR_SUB_ONE;
- continue;
- case 'W':
- tmpparsestate.oneBigWord = TRUE;
- continue;
- }
- break;
- }
-
- termc = *cp;
- newStr = VarModify(ctxt, &tmpparsestate, nstr,
- VarSubstitute,
- (ClientData)&pattern);
-
- /*
- * Free the two strings.
- */
- free(UNCONST(pattern.lhs));
- free(UNCONST(pattern.rhs));
- delim = '\0';
- break;
- }
- case '?':
- {
- VarPattern pattern;
- Boolean value;
-
- /* find ':', and then substitute accordingly */
-
- pattern.flags = 0;
-
- cp = ++tstr;
- delim = ':';
- if ((pattern.lhs = VarGetPattern(ctxt, &parsestate, err,
- &cp, delim, NULL,
- &pattern.leftLen,
- NULL)) == NULL)
- goto cleanup;
-
- /* BROPEN or PROPEN */
- delim = endc;
- if ((pattern.rhs = VarGetPattern(ctxt, &parsestate, err,
- &cp, delim, NULL,
- &pattern.rightLen,
- NULL)) == NULL)
- goto cleanup;
-
- termc = *--cp;
- delim = '\0';
- if (Cond_EvalExpression(1, v->name, &value, 0)
- == COND_INVALID) {
- Error("Bad conditional expression `%s' in %s?%s:%s",
- v->name, v->name, pattern.lhs, pattern.rhs);
- goto cleanup;
- }
-
- if (value) {
- newStr = UNCONST(pattern.lhs);
- free(UNCONST(pattern.rhs));
- } else {
- newStr = UNCONST(pattern.rhs);
- free(UNCONST(pattern.lhs));
- }
- if (v->flags & VAR_JUNK) {
- v->flags |= VAR_KEEP;
- }
- break;
- }
-#ifndef NO_REGEX
- case 'C':
- {
- VarREPattern pattern;
- char *re;
- int error;
- Var_Parse_State tmpparsestate;
-
- pattern.flags = 0;
- tmpparsestate = parsestate;
- delim = tstr[1];
- tstr += 2;
-
- cp = tstr;
-
- if ((re = VarGetPattern(ctxt, &parsestate, err, &cp, delim,
- NULL, NULL, NULL)) == NULL)
- goto cleanup;
-
- if ((pattern.replace = VarGetPattern(ctxt, &parsestate,
- err, &cp, delim, NULL,
- NULL, NULL)) == NULL){
- free(re);
- goto cleanup;
- }
-
- for (;; cp++) {
- switch (*cp) {
- case 'g':
- pattern.flags |= VAR_SUB_GLOBAL;
- continue;
- case '1':
- pattern.flags |= VAR_SUB_ONE;
- continue;
- case 'W':
- tmpparsestate.oneBigWord = TRUE;
- continue;
- }
- break;
- }
-
- termc = *cp;
-
- error = regcomp(&pattern.re, re, REG_EXTENDED);
- free(re);
- if (error) {
- *lengthPtr = cp - start + 1;
- VarREError(error, &pattern.re, "RE substitution error");
- free(pattern.replace);
- return (var_Error);
- }
-
- pattern.nsub = pattern.re.re_nsub + 1;
- if (pattern.nsub < 1)
- pattern.nsub = 1;
- if (pattern.nsub > 10)
- pattern.nsub = 10;
- pattern.matches = emalloc(pattern.nsub *
- sizeof(regmatch_t));
- newStr = VarModify(ctxt, &tmpparsestate, nstr,
- VarRESubstitute,
- (ClientData) &pattern);
- regfree(&pattern.re);
- free(pattern.replace);
- free(pattern.matches);
- delim = '\0';
- break;
- }
-#endif
- case 'Q':
- if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarQuote(nstr);
- cp = tstr + 1;
- termc = *cp;
- break;
- }
- goto default_case;
- case 'T':
- if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarModify(ctxt, &parsestate, nstr, VarTail,
- (ClientData)0);
- cp = tstr + 1;
- termc = *cp;
- break;
- }
- goto default_case;
- case 'H':
- if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarModify(ctxt, &parsestate, nstr, VarHead,
- (ClientData)0);
- cp = tstr + 1;
- termc = *cp;
- break;
- }
- goto default_case;
- case 'E':
- if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarModify(ctxt, &parsestate, nstr, VarSuffix,
- (ClientData)0);
- cp = tstr + 1;
- termc = *cp;
- break;
- }
- goto default_case;
- case 'R':
- if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarModify(ctxt, &parsestate, nstr, VarRoot,
- (ClientData)0);
- cp = tstr + 1;
- termc = *cp;
- break;
- }
- goto default_case;
- case 'O':
- {
- char otype;
-
- cp = tstr + 1; /* skip to the rest in any case */
- if (tstr[1] == endc || tstr[1] == ':') {
- otype = 's';
- termc = *cp;
- } else if ( (tstr[1] == 'x') &&
- (tstr[2] == endc || tstr[2] == ':') ) {
- otype = tstr[1];
- cp = tstr + 2;
- termc = *cp;
- } else {
- goto bad_modifier;
- }
- newStr = VarOrder(nstr, otype);
- break;
- }
- case 'u':
- if (tstr[1] == endc || tstr[1] == ':') {
- newStr = VarUniq(nstr);
- cp = tstr + 1;
- termc = *cp;
- break;
- }
- goto default_case;
-#ifdef SUNSHCMD
- case 's':
- if (tstr[1] == 'h' && (tstr[2] == endc || tstr[2] == ':')) {
- const char *emsg;
- newStr = Cmd_Exec(nstr, &emsg);
- if (emsg)
- Error(emsg, nstr);
- cp = tstr + 2;
- termc = *cp;
- break;
- }
- goto default_case;
-#endif
- default:
- default_case:
- {
-#ifdef SYSVVARSUB
- /*
- * This can either be a bogus modifier or a System-V
- * substitution command.
- */
- VarPattern pattern;
- Boolean eqFound;
-
- pattern.flags = 0;
- eqFound = FALSE;
- /*
- * First we make a pass through the string trying
- * to verify it is a SYSV-make-style translation:
- * it must be: <string1>=<string2>)
- */
- cp = tstr;
- cnt = 1;
- while (*cp != '\0' && cnt) {
- if (*cp == '=') {
- eqFound = TRUE;
- /* continue looking for endc */
- }
- else if (*cp == endc)
- cnt--;
- else if (*cp == startc)
- cnt++;
- if (cnt)
- cp++;
- }
- if (*cp == endc && eqFound) {
-
- /*
- * Now we break this sucker into the lhs and
- * rhs. We must null terminate them of course.
- */
- delim='=';
- cp = tstr;
- if ((pattern.lhs = VarGetPattern(ctxt, &parsestate,
- err, &cp, delim, &pattern.flags,
- &pattern.leftLen, NULL)) == NULL)
- goto cleanup;
- delim = endc;
- if ((pattern.rhs = VarGetPattern(ctxt, &parsestate,
- err, &cp, delim, NULL, &pattern.rightLen,
- &pattern)) == NULL)
- goto cleanup;
-
- /*
- * SYSV modifications happen through the whole
- * string. Note the pattern is anchored at the end.
- */
- termc = *--cp;
- delim = '\0';
- newStr = VarModify(ctxt, &parsestate, nstr,
- VarSYSVMatch,
- (ClientData)&pattern);
- free(UNCONST(pattern.lhs));
- free(UNCONST(pattern.rhs));
- } else
-#endif
- {
- Error("Unknown modifier '%c'", *tstr);
- for (cp = tstr+1;
- *cp != ':' && *cp != endc && *cp != '\0';
- cp++)
- continue;
- termc = *cp;
- newStr = var_Error;
- }
- }
- }
- if (DEBUG(VAR)) {
- printf("Result is \"%s\"\n", newStr);
- }
-
- if (newStr != nstr) {
- if (*freePtr) {
- free(nstr);
- }
- nstr = newStr;
- if (nstr != var_Error && nstr != varNoError) {
- *freePtr = TRUE;
- } else {
- *freePtr = FALSE;
- }
- }
- if (termc == '\0') {
- Error("Unclosed variable specification for %s", v->name);
- } else if (termc == ':') {
- *WR(cp) = termc;
- cp++;
- } else {
- *WR(cp) = termc;
- }
- tstr = cp;
- }
+ nstr = ApplyModifiers(nstr, tstr, startc, endc,
+ v, ctxt, errnum, &used, freePtr);
+ tstr += used;
+ }
+ if (*tstr) {
*lengthPtr = tstr - start + 1;
} else {
- *lengthPtr = tstr - start + 1;
- *WR(tstr) = endc;
+ *lengthPtr = tstr - start;
}
if (v->flags & VAR_FROM_ENV) {
@@ -3202,28 +3523,23 @@ Var_Parse(const char *str, GNode *ctxt, Boolean err, int *lengthPtr,
* Returning the value unmodified, so tell the caller to free
* the thing.
*/
- *freePtr = TRUE;
+ *freePtr = nstr;
}
- if (nstr != (char *)Buf_GetAll(v->val, NULL))
- Buf_Destroy(v->val, destroy);
- free(v->name);
- free(v);
+ VarFreeEnv(v, destroy);
} else if (v->flags & VAR_JUNK) {
/*
- * Perform any free'ing needed and set *freePtr to FALSE so the caller
+ * Perform any free'ing needed and set *freePtr to NULL so the caller
* doesn't try to free a static pointer.
* If VAR_KEEP is also set then we want to keep str as is.
*/
if (!(v->flags & VAR_KEEP)) {
if (*freePtr) {
free(nstr);
+ *freePtr = NULL;
}
- *freePtr = FALSE;
if (dynamic) {
- nstr = emalloc(*lengthPtr + 1);
- strncpy(nstr, start, *lengthPtr);
- nstr[*lengthPtr] = '\0';
- *freePtr = TRUE;
+ nstr = estrndup(start, *lengthPtr);
+ *freePtr = nstr;
} else {
nstr = var_Error;
}
@@ -3234,20 +3550,6 @@ Var_Parse(const char *str, GNode *ctxt, Boolean err, int *lengthPtr,
free(v);
}
return (nstr);
-
- bad_modifier:
- /* "{(" */
- Error("Bad modifier `:%.*s' for %s", (int)strcspn(tstr, ":)}"), tstr,
- v->name);
-
-cleanup:
- *lengthPtr = cp - start + 1;
- if (*freePtr)
- free(nstr);
- if (delim != '\0')
- Error("Unclosed substitution for %s (%c missing)",
- v->name, delim);
- return (var_Error);
}
/*-
@@ -3277,12 +3579,12 @@ Var_Subst(const char *var, const char *str, GNode *ctxt, Boolean undefErr)
char *val; /* Value to substitute for a variable */
int length; /* Length of the variable invocation */
Boolean trailingBslash; /* variable ends in \ */
- Boolean doFree; /* Set true if val should be freed */
+ void *freeIt = NULL; /* Set if it should be freed */
static Boolean errorReported; /* Set true if an error has already
* been reported to prevent a plethora
* of messages when recursing */
- buf = Buf_Init(MAKE_BSIZE);
+ buf = Buf_Init(0);
errorReported = FALSE;
trailingBslash = FALSE;
@@ -3369,7 +3671,7 @@ Var_Subst(const char *var, const char *str, GNode *ctxt, Boolean undefErr)
continue;
}
- val = Var_Parse(str, ctxt, undefErr, &length, &doFree);
+ val = Var_Parse(str, ctxt, undefErr, &length, &freeIt);
/*
* When we come down here, val should either point to the
@@ -3416,9 +3718,10 @@ Var_Subst(const char *var, const char *str, GNode *ctxt, Boolean undefErr)
length = strlen(val);
Buf_AddBytes(buf, length, (Byte *)val);
trailingBslash = length > 0 && val[length - 1] == '\\';
- if (doFree) {
- free(val);
- }
+ }
+ if (freeIt) {
+ free(freeIt);
+ freeIt = NULL;
}
}
}
@@ -3450,7 +3753,7 @@ Var_Subst(const char *var, const char *str, GNode *ctxt, Boolean undefErr)
char *
Var_GetTail(char *file)
{
- return(VarModify(file, VarTail, (ClientData)0));
+ return(VarModify(file, VarTail, NULL));
}
/*-
@@ -3474,7 +3777,7 @@ Var_GetTail(char *file)
char *
Var_GetHead(char *file)
{
- return(VarModify(file, VarHead, (ClientData)0));
+ return(VarModify(file, VarHead, NULL));
}
#endif
@@ -3510,7 +3813,7 @@ static void
VarPrintVar(ClientData vp)
{
Var *v = (Var *)vp;
- printf("%-16s = %s\n", v->name, (char *)Buf_GetAll(v->val, NULL));
+ fprintf(debug_file, "%-16s = %s\n", v->name, (char *)Buf_GetAll(v->val, NULL));
}
/*-
diff --git a/devel/bmake/files/wait.h b/devel/bmake/files/wait.h
index deab3de759b..28079575abc 100644
--- a/devel/bmake/files/wait.h
+++ b/devel/bmake/files/wait.h
@@ -6,7 +6,7 @@
*/
/*
* RCSid:
- * $Id: wait.h,v 1.1.1.1 2005/12/02 00:03:00 sjg Exp $
+ * $Id: wait.h,v 1.2 2008/03/09 19:54:29 joerg Exp $
*
* @(#)Copyright (c) 1994, Simon J. Gerraty.
*