summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog51
-rw-r--r--NEWS7
-rw-r--r--aclocal.m44
-rw-r--r--checks/01.define2
-rw-r--r--checks/02.arguments2
-rw-r--r--checks/03.arguments2
-rw-r--r--checks/04.arguments2
-rw-r--r--checks/05.arguments2
-rw-r--r--checks/06.pseudo_argu2
-rw-r--r--checks/07.pseudo_argu2
-rw-r--r--checks/08.pseudo_argu2
-rw-r--r--checks/09.pseudo_argu2
-rw-r--r--checks/10.pseudo_argu2
-rw-r--r--checks/11.undefine2
-rw-r--r--checks/12.defn2
-rw-r--r--checks/13.pushdef2
-rw-r--r--checks/14.pushdef2
-rw-r--r--checks/15.indir2
-rw-r--r--checks/16.ifdef2
-rw-r--r--checks/17.ifelse2
-rw-r--r--checks/18.ifelse2
-rw-r--r--checks/19.loops2
-rw-r--r--checks/20.loops2
-rw-r--r--checks/21.dumpdef2
-rw-r--r--checks/22.trace2
-rw-r--r--checks/23.dnl2
-rw-r--r--checks/24.changequote2
-rw-r--r--checks/25.changequote2
-rw-r--r--checks/26.changequote2
-rw-r--r--checks/27.changecom2
-rw-r--r--checks/28.changecom2
-rw-r--r--checks/29.m4wrap2
-rw-r--r--checks/30.include2
-rw-r--r--checks/31.include2
-rw-r--r--checks/32.include2
-rw-r--r--checks/33.divert2
-rw-r--r--checks/34.divert2
-rw-r--r--checks/35.undivert2
-rw-r--r--checks/36.undivert2
-rw-r--r--checks/37.undivert2
-rw-r--r--checks/38.divnum2
-rw-r--r--checks/39.cleardiv2
-rw-r--r--checks/40.cleardiv2
-rw-r--r--checks/41.len2
-rw-r--r--checks/42.index2
-rw-r--r--checks/43.regexp2
-rw-r--r--checks/44.regexp2
-rw-r--r--checks/45.substr2
-rw-r--r--checks/46.translit2
-rw-r--r--checks/47.patsubst2
-rw-r--r--checks/48.patsubst2
-rw-r--r--checks/49.format2
-rw-r--r--checks/50.incr2
-rw-r--r--checks/51.eval2
-rw-r--r--checks/52.eval2
-rw-r--r--checks/53.esyscmd2
-rw-r--r--checks/54.sysval2
-rw-r--r--checks/55.errprint2
-rw-r--r--checks/56.errprint2
-rw-r--r--checks/57.m4exit2
-rwxr-xr-xchecks/check-them2
-rw-r--r--config.h.in193
-rwxr-xr-xconfigure6755
-rw-r--r--configure.in6
-rw-r--r--doc/Makefile.in4
-rw-r--r--doc/m4.info3255
-rw-r--r--doc/m4.info-11495
-rw-r--r--doc/m4.info-21468
-rw-r--r--doc/m4.info-3227
-rw-r--r--doc/m4.texinfo34
-rw-r--r--doc/stamp-vti2
-rw-r--r--doc/texinfo.tex2
-rw-r--r--doc/version.texi6
-rw-r--r--examples/stackovf.sh2
-rw-r--r--src/builtin.c18
-rw-r--r--src/debug.c10
-rw-r--r--src/m4.c4
-rw-r--r--src/m4.h6
-rw-r--r--src/output.c10
-rw-r--r--src/symtab.c9
-rw-r--r--stamp-h.in2
81 files changed, 8943 insertions, 4743 deletions
diff --git a/ChangeLog b/ChangeLog
index 664472a5..79f25cbe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,54 @@
+2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
+
+ * Release 1.4.1.
+
+ * configure.in (VERSION): Bump to 1.4.1.
+ * NEWS: Describe 1.4.1's changes.
+
+ * aclocal.m4 (fp_PROG_CC_STDC): Use AC_DEFUN, not define, to
+ pacify Autoconf 2.59.
+
+ * doc/m4.texinfo: Insert commas after @xref's that lack them,
+ to pacify Texinfo 4.7.
+ * doc/Makefile.in (info): Remove info-1, info-2, info-3.
+
+ * src/m4.h, src/debug.c: Use #ifdef __STDC__, not #if __STDC__, to
+ pacify Sun C compilers.
+
+2003-09-28 Akim Demaille <akim@epita.fr>
+
+ * src/symtab.c (lookup_symbol): Fix an uninitialized-variable
+ botch.
+
+2003-09-03 Santiago Vila <sanvila@debian.org>
+
+ * examples/stackovf.sh: Use tempfile if available.
+
+2001-04-02 Robert Bihlmeyer <robbe@orcus.priv.at>
+
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=92629
+ * src/output.c (m4_insert_file): Do not mix buffered and
+ unbuffered I/O, as this breaks on the Hurd. (trivial change)
+
+2001-02-01 Santiago Vila <sanvila@debian.org>
+
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84451
+ * src/m4.c (main): Fix format vulnerabilities. (trivial change)
+
+2001-02-01 Matt Kraai <kraai@debian.org>
+
+ http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84416
+ * doc/m4.texinfo (Maketemp): Change maketemp to refer to a new,
+ empty file rather than to a nonexistent file. This closes a common
+ security hole.
+ * src/builtin.c (m4_maketemp): Implement the above, by using
+ mkstemp rather than mktemp. (trivial change)
+
+2000-01-09 Akim Demaille <demaille@inf.enst.fr>
+
+ * src/builtin.c (expand_ranges): Added break after trailing dash.
+ This caused misbehaviors on some systems.
+
Sat Nov 5 15:52:47 1994 Francois Pinard (pinard@icule)
* Release 1.4.
diff --git a/NEWS b/NEWS
index 932085e5..17021f21 100644
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,10 @@
GNU m4 NEWS - User visible changes.
-Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 2004 Free Software Foundation, Inc.
+
+Version 1.4.1 - June 2004, by Paul Eggert
+
+* maketemp now creates an empty file with the given name, instead of merely
+ returning the name of a nonexistent file. This closes a security hole.
Version 1.4 - October 1994, by Franc,ois Pinard
diff --git a/aclocal.m4 b/aclocal.m4
index 90812401..2e694939 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,5 +1,5 @@
# Local additions to Autoconf macros.
-# Copyright (C) 1992, 1994 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1994, 2004 Free Software Foundation, Inc.
# Francois Pinard <pinard@iro.umontreal.ca>, 1992.
# @defmac AC_PROG_CC_STDC
@@ -18,7 +18,7 @@
# program @code{ansi2knr}, which comes with Ghostscript.
# @end defmac
-define(fp_PROG_CC_STDC,
+AC_DEFUN([fp_PROG_CC_STDC],
[AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C)
AC_CACHE_VAL(ac_cv_prog_cc_stdc,
[ac_cv_prog_cc_stdc=no
diff --git a/checks/01.define b/checks/01.define
index 7a044c01..264e9f74 100644
--- a/checks/01.define
+++ b/checks/01.define
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:939: Origin of test
+dnl ../doc/m4.texinfo:940: Origin of test
define(`foo', `Hello world.')
dnl @result{}
foo
diff --git a/checks/02.arguments b/checks/02.arguments
index 0d459123..561592de 100644
--- a/checks/02.arguments
+++ b/checks/02.arguments
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:963: Origin of test
+dnl ../doc/m4.texinfo:964: Origin of test
define(`exch', `$2, $1')
dnl @result{}
exch(arg1, arg2)
diff --git a/checks/03.arguments b/checks/03.arguments
index 9117964b..c9830ecf 100644
--- a/checks/03.arguments
+++ b/checks/03.arguments
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:973: Origin of test
+dnl ../doc/m4.texinfo:974: Origin of test
define(`exch', `$2, $1')
dnl @result{}
define(exch(``expansion text'', ``macro''))
diff --git a/checks/04.arguments b/checks/04.arguments
index 8d325ac4..fb87fb52 100644
--- a/checks/04.arguments
+++ b/checks/04.arguments
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:993: Origin of test
+dnl ../doc/m4.texinfo:994: Origin of test
define(`test', ``Macro name: $0'')
dnl @result{}
test
diff --git a/checks/05.arguments b/checks/05.arguments
index aaed75e0..faaf8a3a 100644
--- a/checks/05.arguments
+++ b/checks/05.arguments
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1003: Origin of test
+dnl ../doc/m4.texinfo:1004: Origin of test
define(`foo', `This is macro `foo'.')
dnl @result{}
foo
diff --git a/checks/06.pseudo_argu b/checks/06.pseudo_argu
index 8c1f9dfd..51d93597 100644
--- a/checks/06.pseudo_argu
+++ b/checks/06.pseudo_argu
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1027: Origin of test
+dnl ../doc/m4.texinfo:1028: Origin of test
define(`nargs', `$#')
dnl @result{}
nargs
diff --git a/checks/07.pseudo_argu b/checks/07.pseudo_argu
index 0517066c..67c0e66f 100644
--- a/checks/07.pseudo_argu
+++ b/checks/07.pseudo_argu
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1041: Origin of test
+dnl ../doc/m4.texinfo:1042: Origin of test
define(`echo', `$*')
dnl @result{}
echo(arg1, arg2, arg3 , arg4)
diff --git a/checks/08.pseudo_argu b/checks/08.pseudo_argu
index 8787b016..f79abeb2 100644
--- a/checks/08.pseudo_argu
+++ b/checks/08.pseudo_argu
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1052: Origin of test
+dnl ../doc/m4.texinfo:1053: Origin of test
define(`echo', `$@')
dnl @result{}
echo(arg1, arg2, arg3 , arg4)
diff --git a/checks/09.pseudo_argu b/checks/09.pseudo_argu
index 440d7e7f..42b59370 100644
--- a/checks/09.pseudo_argu
+++ b/checks/09.pseudo_argu
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1062: Origin of test
+dnl ../doc/m4.texinfo:1063: Origin of test
define(`echo1', `$*')
dnl @result{}
define(`echo2', `$@')
diff --git a/checks/10.pseudo_argu b/checks/10.pseudo_argu
index 1842e3ed..e8052b1d 100644
--- a/checks/10.pseudo_argu
+++ b/checks/10.pseudo_argu
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1082: Origin of test
+dnl ../doc/m4.texinfo:1083: Origin of test
define(`foo', `$$$ hello $$$')
dnl @result{}
foo
diff --git a/checks/11.undefine b/checks/11.undefine
index 9709263d..32e9171e 100644
--- a/checks/11.undefine
+++ b/checks/11.undefine
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1113: Origin of test
+dnl ../doc/m4.texinfo:1114: Origin of test
foo
dnl @result{}foo
define(`foo', `expansion text')
diff --git a/checks/12.defn b/checks/12.defn
index 9ebb42da..0cb892cc 100644
--- a/checks/12.defn
+++ b/checks/12.defn
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1158: Origin of test
+dnl ../doc/m4.texinfo:1159: Origin of test
define(`zap', defn(`undefine'))
dnl @result{}
zap(`undefine')
diff --git a/checks/13.pushdef b/checks/13.pushdef
index bdf078ba..e988d79a 100644
--- a/checks/13.pushdef
+++ b/checks/13.pushdef
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1204: Origin of test
+dnl ../doc/m4.texinfo:1205: Origin of test
define(`foo', `Expansion one.')
dnl @result{}
foo
diff --git a/checks/14.pushdef b/checks/14.pushdef
index dda7d3fe..6e0eff3f 100644
--- a/checks/14.pushdef
+++ b/checks/14.pushdef
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1228: Origin of test
+dnl ../doc/m4.texinfo:1229: Origin of test
define(`foo', `Expansion one.')
dnl @result{}
foo
diff --git a/checks/15.indir b/checks/15.indir
index 881b4deb..659aa945 100644
--- a/checks/15.indir
+++ b/checks/15.indir
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1272: Origin of test
+dnl ../doc/m4.texinfo:1273: Origin of test
define(`$$internal$macro', `Internal macro (name `$0')')
dnl @result{}
$$internal$macro
diff --git a/checks/16.ifdef b/checks/16.ifdef
index c4dec7b5..e9df0bc1 100644
--- a/checks/16.ifdef
+++ b/checks/16.ifdef
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1343: Origin of test
+dnl ../doc/m4.texinfo:1344: Origin of test
ifdef(`foo', ``foo' is defined', ``foo' is not defined')
dnl @result{}foo is not defined
define(`foo', `')
diff --git a/checks/17.ifelse b/checks/17.ifelse
index 836a98f0..8713e027 100644
--- a/checks/17.ifelse
+++ b/checks/17.ifelse
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1381: Origin of test
+dnl ../doc/m4.texinfo:1382: Origin of test
ifelse(foo, bar, `true')
dnl @result{}
ifelse(foo, foo, `true')
diff --git a/checks/18.ifelse b/checks/18.ifelse
index ddfb7fbb..36c89265 100644
--- a/checks/18.ifelse
+++ b/checks/18.ifelse
@@ -1,3 +1,3 @@
-dnl ../doc/m4.texinfo:1400: Origin of test
+dnl ../doc/m4.texinfo:1401: Origin of test
ifelse(foo, bar, `third', gnu, gnats, `sixth', `seventh')
dnl @result{}seventh
diff --git a/checks/19.loops b/checks/19.loops
index 8ac68eb9..e22a0b2b 100644
--- a/checks/19.loops
+++ b/checks/19.loops
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1437: Origin of test
+dnl ../doc/m4.texinfo:1438: Origin of test
shift(bar)
dnl @result{}
shift(foo, bar, baz)
diff --git a/checks/20.loops b/checks/20.loops
index 55dfc86c..df647b52 100644
--- a/checks/20.loops
+++ b/checks/20.loops
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1447: Origin of test
+dnl ../doc/m4.texinfo:1448: Origin of test
define(`reverse', `ifelse($#, 0, , $#, 1, ``$1'',
`reverse(shift($@)), `$1'')')
dnl @result{}
diff --git a/checks/21.dumpdef b/checks/21.dumpdef
index 689bb786..f1968939 100644
--- a/checks/21.dumpdef
+++ b/checks/21.dumpdef
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1561: Origin of test
+dnl ../doc/m4.texinfo:1562: Origin of test
define(`foo', `Hello world.')
dnl @result{}
dumpdef(`foo')
diff --git a/checks/22.trace b/checks/22.trace
index ae4e639c..36b119c0 100644
--- a/checks/22.trace
+++ b/checks/22.trace
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1606: Origin of test
+dnl ../doc/m4.texinfo:1607: Origin of test
define(`foo', `Hello World.')
dnl @result{}
define(`echo', `$@')
diff --git a/checks/23.dnl b/checks/23.dnl
index 763d9843..9ba7a11f 100644
--- a/checks/23.dnl
+++ b/checks/23.dnl
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1757: Origin of test
+dnl ../doc/m4.texinfo:1758: Origin of test
define(`foo', `Macro `foo'.')dnl A very simple macro, indeed.
foo
dnl @result{}Macro foo.
diff --git a/checks/24.changequote b/checks/24.changequote
index c74dafdf..093dfe2e 100644
--- a/checks/24.changequote
+++ b/checks/24.changequote
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1795: Origin of test
+dnl ../doc/m4.texinfo:1796: Origin of test
changequote([, ])
dnl @result{}
define([foo], [Macro [foo].])
diff --git a/checks/25.changequote b/checks/25.changequote
index b3976016..79c8ce4b 100644
--- a/checks/25.changequote
+++ b/checks/25.changequote
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1807: Origin of test
+dnl ../doc/m4.texinfo:1808: Origin of test
changequote([[, ]])
dnl @result{}
define([[foo]], [[Macro [[[foo]]].]])
diff --git a/checks/26.changequote b/checks/26.changequote
index 2187982b..1271d5cd 100644
--- a/checks/26.changequote
+++ b/checks/26.changequote
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1819: Origin of test
+dnl ../doc/m4.texinfo:1820: Origin of test
define(`foo', `Macro `FOO'.')
dnl @result{}
changequote(, )
diff --git a/checks/27.changecom b/checks/27.changecom
index 108cbb59..61132c2c 100644
--- a/checks/27.changecom
+++ b/checks/27.changecom
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1859: Origin of test
+dnl ../doc/m4.texinfo:1860: Origin of test
define(`comment', `COMMENT')
dnl @result{}
# A normal comment
diff --git a/checks/28.changecom b/checks/28.changecom
index 35604dee..b645df60 100644
--- a/checks/28.changecom
+++ b/checks/28.changecom
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:1880: Origin of test
+dnl ../doc/m4.texinfo:1881: Origin of test
define(`comment', `COMMENT')
dnl @result{}
changecom
diff --git a/checks/29.m4wrap b/checks/29.m4wrap
index b303c56c..786d6a77 100644
--- a/checks/29.m4wrap
+++ b/checks/29.m4wrap
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2019: Origin of test
+dnl ../doc/m4.texinfo:2020: Origin of test
define(`cleanup', `This is the `cleanup' actions.
')
dnl @result{}
diff --git a/checks/30.include b/checks/30.include
index 85968c80..f37a3f91 100644
--- a/checks/30.include
+++ b/checks/30.include
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2078: Origin of test
+dnl ../doc/m4.texinfo:2079: Origin of test
include(`no-such-file')
dnl @result{}
dnl @error{}30.include:2: m4: Cannot open no-such-file: No such file or directory
diff --git a/checks/31.include b/checks/31.include
index 1d3e01bc..b8bf2bff 100644
--- a/checks/31.include
+++ b/checks/31.include
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2098: Origin of test
+dnl ../doc/m4.texinfo:2099: Origin of test
define(`foo', `FOO')
dnl @result{}
include(`incl.m4')
diff --git a/checks/32.include b/checks/32.include
index ba3208f5..6807509d 100644
--- a/checks/32.include
+++ b/checks/32.include
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2113: Origin of test
+dnl ../doc/m4.texinfo:2114: Origin of test
define(`bar', include(`incl.m4'))
dnl @result{}
This is `bar': >>>bar<<<
diff --git a/checks/33.divert b/checks/33.divert
index 1f90fa5f..2a6b77a2 100644
--- a/checks/33.divert
+++ b/checks/33.divert
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2201: Origin of test
+dnl ../doc/m4.texinfo:2202: Origin of test
divert(1)
This text is diverted.
divert
diff --git a/checks/34.divert b/checks/34.divert
index 6f0a8a78..7b9bd807 100644
--- a/checks/34.divert
+++ b/checks/34.divert
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2221: Origin of test
+dnl ../doc/m4.texinfo:2222: Origin of test
divert(-1)
define(`foo', `Macro `foo'.')
define(`bar', `Macro `bar'.')
diff --git a/checks/35.undivert b/checks/35.undivert
index a67dce3c..3ccdfbe4 100644
--- a/checks/35.undivert
+++ b/checks/35.undivert
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2252: Origin of test
+dnl ../doc/m4.texinfo:2253: Origin of test
divert(1)
This text is diverted.
divert
diff --git a/checks/36.undivert b/checks/36.undivert
index 59e2741d..bc5d0f38 100644
--- a/checks/36.undivert
+++ b/checks/36.undivert
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2276: Origin of test
+dnl ../doc/m4.texinfo:2277: Origin of test
divert(1)
This text is diverted first.
divert(0)undivert(1)dnl
diff --git a/checks/37.undivert b/checks/37.undivert
index 98a11953..a7e4ab0e 100644
--- a/checks/37.undivert
+++ b/checks/37.undivert
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2302: Origin of test
+dnl ../doc/m4.texinfo:2303: Origin of test
define(`bar', `BAR')
dnl @result{}
undivert(`foo')
diff --git a/checks/38.divnum b/checks/38.divnum
index e56346ee..fbe1dc1a 100644
--- a/checks/38.divnum
+++ b/checks/38.divnum
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2328: Origin of test
+dnl ../doc/m4.texinfo:2329: Origin of test
Initial divnum
dnl @result{}Initial 0
divert(1)
diff --git a/checks/39.cleardiv b/checks/39.cleardiv
index ab3176b7..57778f25 100644
--- a/checks/39.cleardiv
+++ b/checks/39.cleardiv
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2359: Origin of test
+dnl ../doc/m4.texinfo:2360: Origin of test
divert(1)
Diversion one: divnum
divert(2)
diff --git a/checks/40.cleardiv b/checks/40.cleardiv
index 9d095038..6b1aa89f 100644
--- a/checks/40.cleardiv
+++ b/checks/40.cleardiv
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2374: Origin of test
+dnl ../doc/m4.texinfo:2375: Origin of test
define(`cleardivert',
`pushdef(`_num', divnum)divert(-1)undivert($@)divert(_num)popdef(`_num')')
dnl @result{}
diff --git a/checks/41.len b/checks/41.len
index 1c64b8e4..82ccf347 100644
--- a/checks/41.len
+++ b/checks/41.len
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2416: Origin of test
+dnl ../doc/m4.texinfo:2417: Origin of test
len()
dnl @result{}0
len(`abcdef')
diff --git a/checks/42.index b/checks/42.index
index bac694f7..cacce344 100644
--- a/checks/42.index
+++ b/checks/42.index
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2442: Origin of test
+dnl ../doc/m4.texinfo:2443: Origin of test
index(`gnus, gnats, and armadillos', `nat')
dnl @result{}7
index(`gnus, gnats, and armadillos', `dag')
diff --git a/checks/43.regexp b/checks/43.regexp
index 3ea5cac3..79030b16 100644
--- a/checks/43.regexp
+++ b/checks/43.regexp
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2474: Origin of test
+dnl ../doc/m4.texinfo:2475: Origin of test
regexp(`GNUs not Unix', `\<[a-z]\w+')
dnl @result{}5
regexp(`GNUs not Unix', `\<Q\w*')
diff --git a/checks/44.regexp b/checks/44.regexp
index 8636b787..eb2774bc 100644
--- a/checks/44.regexp
+++ b/checks/44.regexp
@@ -1,3 +1,3 @@
-dnl ../doc/m4.texinfo:2486: Origin of test
+dnl ../doc/m4.texinfo:2487: Origin of test
regexp(`GNUs not Unix', `\w\(\w+\)$', `*** \& *** \1 ***')
dnl @result{}*** Unix *** nix ***
diff --git a/checks/45.substr b/checks/45.substr
index a60c791b..e9da7187 100644
--- a/checks/45.substr
+++ b/checks/45.substr
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2512: Origin of test
+dnl ../doc/m4.texinfo:2513: Origin of test
substr(`gnus, gnats, and armadillos', 6)
dnl @result{}gnats, and armadillos
substr(`gnus, gnats, and armadillos', 6, 5)
diff --git a/checks/46.translit b/checks/46.translit
index 78c10daa..b181a82f 100644
--- a/checks/46.translit
+++ b/checks/46.translit
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2553: Origin of test
+dnl ../doc/m4.texinfo:2554: Origin of test
translit(`GNUs not Unix', `A-Z')
dnl @result{}s not nix
translit(`GNUs not Unix', `a-z', `A-Z')
diff --git a/checks/47.patsubst b/checks/47.patsubst
index 8235b50c..9887ccc4 100644
--- a/checks/47.patsubst
+++ b/checks/47.patsubst
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2604: Origin of test
+dnl ../doc/m4.texinfo:2605: Origin of test
patsubst(`GNUs not Unix', `^', `OBS: ')
dnl @result{}OBS: GNUs not Unix
patsubst(`GNUs not Unix', `\<', `OBS: ')
diff --git a/checks/48.patsubst b/checks/48.patsubst
index 0e042a62..3b320d93 100644
--- a/checks/48.patsubst
+++ b/checks/48.patsubst
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2621: Origin of test
+dnl ../doc/m4.texinfo:2622: Origin of test
define(`upcase', `translit(`$*', `a-z', `A-Z')')dnl
define(`downcase', `translit(`$*', `A-Z', `a-z')')dnl
define(`capitalize1',
diff --git a/checks/49.format b/checks/49.format
index 0daa49a7..a14144b0 100644
--- a/checks/49.format
+++ b/checks/49.format
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2656: Origin of test
+dnl ../doc/m4.texinfo:2657: Origin of test
define(`foo', `The brown fox jumped over the lazy dog')
dnl @result{}
format(`The string "%s" is %d characters long', foo, len(foo))
diff --git a/checks/50.incr b/checks/50.incr
index 45ee7226..48464623 100644
--- a/checks/50.incr
+++ b/checks/50.incr
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2726: Origin of test
+dnl ../doc/m4.texinfo:2727: Origin of test
incr(4)
dnl @result{}5
decr(7)
diff --git a/checks/51.eval b/checks/51.eval
index dcf04759..971bd258 100644
--- a/checks/51.eval
+++ b/checks/51.eval
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2808: Origin of test
+dnl ../doc/m4.texinfo:2809: Origin of test
eval(-3 * 5)
dnl @result{}-15
eval(index(`Hello world', `llo') >= 0)
diff --git a/checks/52.eval b/checks/52.eval
index b6a0da83..150c9604 100644
--- a/checks/52.eval
+++ b/checks/52.eval
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2839: Origin of test
+dnl ../doc/m4.texinfo:2840: Origin of test
eval(666, 10)
dnl @result{}666
eval(666, 11)
diff --git a/checks/53.esyscmd b/checks/53.esyscmd
index c92f7941..6bdbb5fa 100644
--- a/checks/53.esyscmd
+++ b/checks/53.esyscmd
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2924: Origin of test
+dnl ../doc/m4.texinfo:2925: Origin of test
define(`vice', `esyscmd(grep Vice ../COPYING)')
dnl @result{}
vice
diff --git a/checks/54.sysval b/checks/54.sysval
index bc9400db..1897cb6d 100644
--- a/checks/54.sysval
+++ b/checks/54.sysval
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:2955: Origin of test
+dnl ../doc/m4.texinfo:2956: Origin of test
syscmd(`false')
dnl @result{}
ifelse(sysval, 0, zero, non-zero)
diff --git a/checks/55.errprint b/checks/55.errprint
index ba292c22..e965e38a 100644
--- a/checks/55.errprint
+++ b/checks/55.errprint
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:3034: Origin of test
+dnl ../doc/m4.texinfo:3028: Origin of test
errprint(`Illegal arguments to forloop
')
dnl @error{}Illegal arguments to forloop
diff --git a/checks/56.errprint b/checks/56.errprint
index a5be31ff..1ec4bfff 100644
--- a/checks/56.errprint
+++ b/checks/56.errprint
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:3059: Origin of test
+dnl ../doc/m4.texinfo:3053: Origin of test
errprint(`m4:'__file__:__line__: `Input error
')
dnl @error{}m4:56.errprint:2: Input error
diff --git a/checks/57.m4exit b/checks/57.m4exit
index 2cbb2d18..f44e48ec 100644
--- a/checks/57.m4exit
+++ b/checks/57.m4exit
@@ -1,4 +1,4 @@
-dnl ../doc/m4.texinfo:3082: Origin of test
+dnl ../doc/m4.texinfo:3076: Origin of test
define(`fatal_error', `errprint(`m4: '__file__: __line__`: fatal error: $*
')m4exit(1)')
dnl @result{}
diff --git a/checks/check-them b/checks/check-them
index 5dd205b9..65a3aadc 100755
--- a/checks/check-them
+++ b/checks/check-them
@@ -14,7 +14,7 @@ m4 --version
for file
do
echo "Checking $file"
- m4 -d $file >$out 2>$err
+ LC_MESSAGES=C m4 -d $file >$out 2>$err
sed -e '/^dnl @result{}/!d' -e 's///' $file > $xout
diff --git a/config.h.in b/config.h.in
index c3e44e7e..3be365a5 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,61 +1,8 @@
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-#undef _ALL_SOURCE
-#endif
-
-/* Define if using alloca.c. */
-#undef C_ALLOCA
-
-/* Define to empty if the keyword does not work. */
-#undef const
-
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-#undef CRAY_STACKSEG_END
-
-/* Define if you have alloca, as a function or macro. */
-#undef HAVE_ALLOCA
-
-/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
-#undef HAVE_ALLOCA_H
-
-/* Define if you don't have vprintf but do have _doprnt. */
-#undef HAVE_DOPRNT
-
-/* Define if you have the vprintf function. */
-#undef HAVE_VPRINTF
-
-/* Define if on MINIX. */
-#undef _MINIX
-
-/* Define if the system does not provide POSIX.1 features except
- with this defined. */
-#undef _POSIX_1_SOURCE
-
-/* Define if you need to in order for stat and other things to work. */
-#undef _POSIX_SOURCE
-
-/* Define as the return type of signal handlers (int or void). */
-#undef RETSIGTYPE
-
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-#undef size_t
-
-/* If using the C implementation of alloca, define if you know the
- direction of stack growth for your system; otherwise it will be
- automatically deduced at run-time.
- STACK_DIRECTION > 0 => grows toward higher addresses
- STACK_DIRECTION < 0 => grows toward lower addresses
- STACK_DIRECTION = 0 => direction of growth unknown
- */
-#undef STACK_DIRECTION
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
+/* config.h.in. Generated from configure.in by autoheader. */
+/* Special definitions for GNU m4, processed by autoheader.
+ Copyright (C) 1993, 1994 Free Software Foundation, Inc.
+ Francois Pinard <pinard@iro.umontreal.ca>, 1993.
+*/
/* Define to 1 if the changeword(REGEXP) functionnality is wanted. */
#undef ENABLE_CHANGEWORD
@@ -89,41 +36,135 @@
site ftp.antaire.com in antaire/src, file dmalloc/dmalloc.tar.gz. */
#undef WITH_DMALLOC
-/* Define if you have the ecvt function. */
+/* Define to one of `_getb67', `GETB67', `getb67' for Cray-2 and Cray-YMP
+ systems. This function is required for `alloca.c' support on those systems.
+ */
+#undef CRAY_STACKSEG_END
+
+/* Define to 1 if using `alloca.c'. */
+#undef C_ALLOCA
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#undef HAVE_ALLOCA
+
+/* Define to 1 if you have <alloca.h> and it should be used (not on Ultrix).
+ */
+#undef HAVE_ALLOCA_H
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
+
+/* Define to 1 if you have the `ecvt' function. */
#undef HAVE_ECVT
-/* Define if you have the mkstemp function. */
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <limits.h> header file. */
+#undef HAVE_LIMITS_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `mkstemp' function. */
#undef HAVE_MKSTEMP
-/* Define if you have the sigaction function. */
+/* Define to 1 if you have the `sigaction' function. */
#undef HAVE_SIGACTION
-/* Define if you have the sigaltstack function. */
+/* Define to 1 if you have the `sigaltstack' function. */
#undef HAVE_SIGALTSTACK
-/* Define if you have the sigstack function. */
+/* Define to 1 if you have the <siginfo.h> header file. */
+#undef HAVE_SIGINFO_H
+
+/* Define to 1 if you have the `sigstack' function. */
#undef HAVE_SIGSTACK
-/* Define if you have the sigvec function. */
+/* Define to 1 if you have the `sigvec' function. */
#undef HAVE_SIGVEC
-/* Define if you have the strerror function. */
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
-/* Define if you have the tmpfile function. */
-#undef HAVE_TMPFILE
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
-/* Define if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
-/* Define if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
+/* Define to 1 if you have the `strtol' function. */
+#undef HAVE_STRTOL
-/* Define if you have the <siginfo.h> header file. */
-#undef HAVE_SIGINFO_H
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
-/* Define if you have the <string.h> header file. */
-#undef HAVE_STRING_H
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the `tmpfile' function. */
+#undef HAVE_TMPFILE
-/* Define if you have the <unistd.h> header file. */
+/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `vprintf' function. */
+#undef HAVE_VPRINTF
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+#undef STACK_DIRECTION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if on AIX 3.
+ System headers sometimes define this.
+ We just want to avoid a redefinition error message. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `unsigned' if <sys/types.h> does not define. */
+#undef size_t
diff --git a/configure b/configure
index b8658a69..a763613b 100755
--- a/configure
+++ b/configure
@@ -1,31 +1,325 @@
-#!/bin/sh
-
+#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.1
-# Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+# Generated by GNU Autoconf 2.59.
#
+# Copyright (C) 2003 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 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+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ 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
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+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
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# 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: 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$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 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
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ 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
+ { (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 sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
-# Defaults:
-ac_help=
+
+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; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+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'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval 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
+
+
+# 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
-# Any additions from configure.in:
-ac_help="$ac_help
- --enable-changeword enable -W and changeword() builtin"
-ac_help="$ac_help
- --with-dmalloc use dmalloc, as in dmalloc.tar.gz from
- @/ftp.antaire.com:antaire/src/dmalloc."
+ac_config_libobj_dir=.
+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=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="src/m4.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#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 datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS PRODUCT VERSION AWK CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA SET_MAKE RANLIB ac_ct_RANLIB CPP EGREP U ANSI2KNR ALLOCA LIBOBJS STACKOVF LTLIBOBJS'
+ac_subst_files=''
# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
# The variables have the same names as the options, with
# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
+cache_file=/dev/null
exec_prefix=NONE
-host=NONE
no_create=
-nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
@@ -34,18 +328,31 @@ program_transform_name=s,x,x,
silent=
site=
srcdir=
-target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
-# Initialize some other variables.
-subdirs=
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
ac_prev=
for ac_option
do
-
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval "$ac_prev=\$ac_option"
@@ -53,48 +360,59 @@ do
continue
fi
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
# Accept the important Cygnus configure options, so we can diagnose typos.
- case "$ac_option" in
+ case $ac_option in
+
+ -bindir | --bindir | --bindi | --bind | --bin | --bi)
+ ac_prev=bindir ;;
+ -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+ bindir=$ac_optarg ;;
- -build | --build | --buil | --bui | --bu | --b)
- ac_prev=build ;;
- -build=* | --build=* | --buil=* | --bui=* | --bu=* | --b=*)
- build="$ac_optarg" ;;
+ -build | --build | --buil | --bui | --bu)
+ ac_prev=build_alias ;;
+ -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+ build_alias=$ac_optarg ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
- cache_file="$ac_optarg" ;;
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
+
+ -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ ac_prev=datadir ;;
+ -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+ | --da=*)
+ datadir=$ac_optarg ;;
-disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- eval "enable_${ac_feature}=no" ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ eval "enable_$ac_feature=no" ;;
-enable-* | --enable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
- fi
- ac_feature=`echo $ac_feature| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
+ eval "enable_$ac_feature='$ac_optarg'" ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -103,83 +421,101 @@ do
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
+ exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
- -help | --help | --hel | --he)
- # Omit some internal or obsolete options to make the list less imposing.
- # This message is too long to be a string in the A/UX 3.1 sh.
- cat << EOF
-Usage: configure [options] [host]
-Options: [defaults in brackets after descriptions]
-Configuration:
- --cache-file=FILE cache test results in FILE
- --help print this message
- --no-create do not create output files
- --quiet, --silent do not print \`checking...' messages
- --version print the version of autoconf that created configure
-Directory and file names:
- --prefix=PREFIX install architecture-independent files in PREFIX
- [$ac_default_prefix]
- --exec-prefix=PREFIX install architecture-dependent files in PREFIX
- [same as prefix]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM run sed PROGRAM on installed program names
-Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
-Features and packages:
- --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
- --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --x-includes=DIR X include files are in DIR
- --x-libraries=DIR X library files are in DIR
---enable and --with options recognized:$ac_help
-EOF
- exit 0 ;;
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
-host | --host | --hos | --ho)
- ac_prev=host ;;
+ ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
+ host_alias=$ac_optarg ;;
+
+ -includedir | --includedir | --includedi | --included | --include \
+ | --includ | --inclu | --incl | --inc)
+ ac_prev=includedir ;;
+ -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+ | --includ=* | --inclu=* | --incl=* | --inc=*)
+ includedir=$ac_optarg ;;
+
+ -infodir | --infodir | --infodi | --infod | --info | --inf)
+ ac_prev=infodir ;;
+ -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+ infodir=$ac_optarg ;;
+
+ -libdir | --libdir | --libdi | --libd)
+ ac_prev=libdir ;;
+ -libdir=* | --libdir=* | --libdi=* | --libd=*)
+ libdir=$ac_optarg ;;
+
+ -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+ | --libexe | --libex | --libe)
+ ac_prev=libexecdir ;;
+ -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+ | --libexe=* | --libex=* | --libe=*)
+ libexecdir=$ac_optarg ;;
+
+ -localstatedir | --localstatedir | --localstatedi | --localstated \
+ | --localstate | --localstat | --localsta | --localst \
+ | --locals | --local | --loca | --loc | --lo)
+ ac_prev=localstatedir ;;
+ -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ localstatedir=$ac_optarg ;;
+
+ -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+ ac_prev=mandir ;;
+ -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+ mandir=$ac_optarg ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c)
+ | --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
+ -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+ | --oldin | --oldi | --old | --ol | --o)
+ ac_prev=oldincludedir ;;
+ -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+ oldincludedir=$ac_optarg ;;
+
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
+ prefix=$ac_optarg ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
- program_prefix="$ac_optarg" ;;
+ program_prefix=$ac_optarg ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
- program_suffix="$ac_optarg" ;;
+ program_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
@@ -196,55 +532,78 @@ EOF
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
+ program_transform_name=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+ ac_prev=sbindir ;;
+ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+ | --sbi=* | --sb=*)
+ sbindir=$ac_optarg ;;
+
+ -sharedstatedir | --sharedstatedir | --sharedstatedi \
+ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+ | --sharedst | --shareds | --shared | --share | --shar \
+ | --sha | --sh)
+ ac_prev=sharedstatedir ;;
+ -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+ | --sha=* | --sh=*)
+ sharedstatedir=$ac_optarg ;;
+
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
+ site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
+ srcdir=$ac_optarg ;;
+
+ -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+ | --syscon | --sysco | --sysc | --sys | --sy)
+ ac_prev=sysconfdir ;;
+ -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+ sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
+ ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
+ target_alias=$ac_optarg ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
- -version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.1"
- exit 0 ;;
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
-with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
- eval "with_${ac_package}='$ac_optarg'" ;;
+ eval "with_$ac_package='$ac_optarg'" ;;
-without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
- { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
- fi
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- eval "with_${ac_package}=no" ;;
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
--x)
# Obsolete; use --with-x.
@@ -255,95 +614,110 @@ EOF
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
- x_includes="$ac_optarg" ;;
+ x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
- x_libraries="$ac_optarg" ;;
+ x_libraries=$ac_optarg ;;
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
;;
- *)
- if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
- echo "configure: warning: $ac_option: invalid host type" 1>&2
- fi
- if test "x$nonopt" != xNONE; then
- { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
- fi
- nonopt="$ac_option"
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
+ *)
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
;;
esac
done
if test -n "$ac_prev"; then
- { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
-fi
-
-trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
-
-# File descriptor usage:
-# 0 unused; standard input
-# 1 file creation
-# 2 errors and warnings
-# 3 unused; some systems may open it to /dev/tty
-# 4 checking for... messages and results
-# 5 compiler messages saved in config.log
-if test "$silent" = yes; then
- exec 4>/dev/null
-else
- exec 4>&1
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); exit 1; }; }
fi
-exec 5>./config.log
-echo "\
-This file contains any messages produced by compilers while
-running configure, to aid debugging if configure makes a mistake.
-" 1>&5
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
-# Strip out --no-create and --no-recursion so they do not pile up.
-# Also quote any args containing shell metacharacters.
-ac_configure_args=
-for ac_arg
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
do
- case "$ac_arg" in
- -no-create | --no-create | --no-creat | --no-crea | --no-cre \
- | --no-cr | --no-c) ;;
- -no-recursion | --no-recursion | --no-recursio | --no-recursi \
- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
- ac_configure_args="$ac_configure_args '$ac_arg'" ;;
- *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+ 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
done
-# NLS nuisances.
-# Only set LANG and LC_ALL to C if already set.
-# These must not be set unconditionally because not all systems understand
-# e.g. LANG=C (notably SCO).
-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
-if test "${LANG+set}" = set; then LANG=C; export LANG; fi
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+fi
-# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo > confdefs.h
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
-# A filename unique to this package, relative to the directory that
-# configure is in, which we can look for to find out if srcdir is correct.
-ac_unique_file=src/m4.c
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then its parent.
- ac_prog=$0
- ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
- test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ 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'`
srcdir=$ac_confdir
if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
@@ -353,13 +727,470 @@ else
fi
if test ! -r $srcdir/$ac_unique_file; then
if test "$ac_srcdir_defaulted" = yes; then
- { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
fi
fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+(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; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # Omit some internal or obsolete options to make the list less imposing.
+ # This message is too long to be a string in the A/UX 3.1 sh.
+ cat <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -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]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+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]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM run sed PROGRAM on installed program names
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-changeword enable -W and changeword() builtin
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-dmalloc use dmalloc, as in dmalloc.tar.gz from
+ @/ftp.antaire.com:antaire/src/dmalloc.
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib 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
+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
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # 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
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ 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 ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+ 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
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+
+Copyright (C) 2003 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 0
+fi
+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.59. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -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
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 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.
+ 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
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# 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: 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.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ 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 &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo >confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
if test "x$prefix" != xNONE; then
@@ -370,175 +1201,1104 @@ if test -z "$CONFIG_SITE"; then
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file"
fi
done
if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
else
- echo "creating cache $cache_file"
- > $cache_file
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
fi
-ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='${CC-cc} $CFLAGS $CPPFLAGS conftest.$ac_ext -c 1>&5 2>&5'
-ac_link='${CC-cc} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext -o conftest $LIBS 1>&5 2>&5'
-
-if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
- # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
- if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
- ac_n= ac_c='
-' ac_t=' '
- else
- ac_n=-n ac_c= ac_t=
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$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: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ 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=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
fi
-else
- ac_n= ac_c='\c' ac_t=
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test "$program_transform_name" = s,x,x,; then
- program_transform_name=
-else
- # Double any \ or $.
- echo 's,\\,\\\\,g; s,\$,$$,g' > conftestsed
- program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
- rm -f conftestsed
-fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ac_config_headers="$ac_config_headers config.h"
+
test "$program_prefix" != NONE &&
- program_transform_name="s,^,${program_prefix},; $program_transform_name"
+ program_transform_name="s,^,$program_prefix,;$program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
- program_transform_name="s,\$\$,${program_suffix},; $program_transform_name"
-
-# sed with no file args requires a program.
-test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
PRODUCT=m4
-VERSION=1.4
-cat >> confdefs.h <<EOF
+VERSION=1.4.1
+cat >>confdefs.h <<_ACEOF
#define PRODUCT "$PRODUCT"
-EOF
+_ACEOF
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
#define VERSION "$VERSION"
-EOF
+_ACEOF
-for ac_prog in mawk gawk nawk awk
+for ac_prog in gawk mawk nawk awk
do
-# Extract the first word of "$ac_prog", so it can be a program name with args.
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_prog_AWK'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$AWK"; then
ac_cv_prog_AWK="$AWK" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_AWK="$ac_prog"
- break
- fi
- done
- IFS="$ac_save_ifs"
+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_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-AWK="$ac_cv_prog_AWK"
+AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- echo "$ac_t""$AWK" 1>&4
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
else
- echo "$ac_t""no" 1>&4
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-test -n "$AWK" && break
+ test -n "$AWK" && break
done
-# Extract the first word of "gcc", so it can be a program name with args.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$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
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$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_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ 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
+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 $ac_n "checking for $ac_word""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+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="gcc"
+ 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
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$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
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_CC="gcc"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="cc"
+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_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&4
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- echo "$ac_t""no" 1>&4
+ 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
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_prog_gcc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+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
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if ${CC-cc} -E conftest.c 2>&5 | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
else
- ac_cv_prog_gcc=no
+ CC="$ac_cv_prog_CC"
fi
+
fi
-echo "$ac_t""$ac_cv_prog_gcc" 1>&4
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
- if test "${CFLAGS+set}" != set; then
- echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_prog_gcc_g'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+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
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
- ac_cv_prog_gcc_g=yes
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
else
- ac_cv_prog_gcc_g=no
+ ac_prog_rejected=no
+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
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+if test $ac_prog_rejected = yes; then
+ # We found a bogon in the path, so make sure we never use it.
+ set dummy $ac_cv_prog_CC
+ shift
+ if test $# != 0; then
+ # We chose a different compiler from the bogus one.
+ # However, it has the same basename, so the bogon will be chosen
+ # first if we set CC to just the basename; use the full file name.
+ shift
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+ fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ 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
+fi
+
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$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
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$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_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ 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
fi
-rm -f conftest*
+ test -n "$CC" && break
+ done
fi
- echo "$ac_t""$ac_cv_prog_gcc_g" 1>&4
- if test $ac_cv_prog_gcc_g = yes; then
- CFLAGS="-g -O"
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo "$as_me:$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="$ac_prog"
+ 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
+
+ test -n "$ac_ct_CC" && break
+done
+
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+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
+ac_compiler=`set X $ac_compile; echo $2`
+{ (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); }
+{ (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); }
+{ (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
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+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
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+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
+ # 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 | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$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'
+ { (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
+ cross_compiling=no
+ else
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
else
- CFLAGS="-O"
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
fi
+fi
+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 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 { (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
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
else
- GCC=
- test "${CFLAGS+set}" = set || CFLAGS="-g"
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
+rm -f conftest$ac_cv_exeext
+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
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ 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.o conftest.obj
+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 `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+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
+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
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.err 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
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+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
+ 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cc_g=no
+fi
+rm -f conftest.err 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
+if test "$ac_test_CFLAGS" = set; then
+ CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+ if test "$GCC" = yes; then
+ CFLAGS="-g -O2"
+ else
+ CFLAGS="-g"
+ fi
+else
+ if test "$GCC" = yes; then
+ CFLAGS="-O2"
+ else
+ CFLAGS=
+ fi
+fi
+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_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+
+/* 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 -std1 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 -std1. */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&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>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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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 \
+ '' \
+ '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
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+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>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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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.err conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+/* 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>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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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.err 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.err conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
@@ -549,14 +2309,20 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
fi
done
if test -z "$ac_aux_dir"; then
- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; }
+ { { 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
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+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
@@ -565,248 +2331,998 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
-echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&4
+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 eval "test \"`echo '${'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- case "$ac_dir" in
- ''|.|/etc|/usr/sbin|/usr/etc|/sbin|/usr/afsws/bin|/usr/ucb) ;;
- *)
- # OSF1 and SCO ODT 3.0 have their own names for install.
- for ac_prog in ginstall installbsd scoinst install; do
- if test -f $ac_dir/$ac_prog; then
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+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.
+ # Don't use installbsd from OSF since it installs stuff as root
+ # by default.
+ for ac_prog in ginstall scoinst install; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
- grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
- # OSF/1 installbsd also uses dspmsg, but is usable.
+ :
+ 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="$ac_dir/$ac_prog -c"
- break 2
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
fi
fi
done
- ;;
- esac
- done
- IFS="$ac_save_ifs"
- # As a last resort, use the slow shell script.
- test -z "$ac_cv_path_install" && ac_cv_path_install="$ac_install_sh"
+ done
+ ;;
+esac
+done
+
+
fi
- INSTALL="$ac_cv_path_install"
+ if test "${ac_cv_path_install+set}" = set; then
+ INSTALL=$ac_cv_path_install
+ else
+ # As a last resort, use the slow shell script. We don't cache a
+ # path for INSTALL within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the path is relative.
+ INSTALL=$ac_install_sh
+ fi
fi
-echo "$ac_t""$INSTALL" 1>&4
+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.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-echo $ac_n "checking whether ${MAKE-make} sets \$MAKE""... $ac_c" 1>&4
-set dummy ${MAKE-make}; ac_make=$2
-if eval "test \"`echo '${'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftestmake <<\EOF
+ cat >conftest.make <<\_ACEOF
all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
if test -n "$ac_maketemp"; then
eval ac_cv_prog_make_${ac_make}_set=yes
else
eval ac_cv_prog_make_${ac_make}_set=no
fi
-rm -f conftestmake
+rm -f conftest.make
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&4
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
SET_MAKE=
else
- echo "$ac_t""no" 1>&4
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
-# Extract the first word of "ranlib", so it can be a program name with args.
-set dummy ranlib; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; 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_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -n "$RANLIB"; then
ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
- for ac_dir in $PATH; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_RANLIB="ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+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_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-RANLIB="$ac_cv_prog_RANLIB"
+RANLIB=$ac_cv_prog_RANLIB
if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&4
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; 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_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&4
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
fi
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&4
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$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=
fi
if test -z "$CPP"; then
-if eval "test \"`echo '${'ac_cv_prog_CPP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- # This must be in double quotes, not single quotes, because CPP may get
- # substituted into the Makefile and "${CC-cc}" will confuse make.
- CPP="${CC-cc} -E"
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 683 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+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; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
:
else
- echo "$ac_err" >&5
- rm -rf conftest*
- CPP="${CC-cc} -E -traditional-cpp"
- cat > conftest.$ac_ext <<EOF
-#line 697 "configure"
-#include "confdefs.h"
-#include <assert.h>
-Syntax Error
-EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
+ echo "$as_me: failed program was:" >&5
+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 non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+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; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # 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
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+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; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
:
else
- echo "$ac_err" >&5
- rm -rf conftest*
- CPP=/lib/cpp
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+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; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$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_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
fi
-CPP="$ac_cv_prog_CPP"
-echo "$ac_t""$CPP" 1>&4
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
-echo $ac_n "checking for AIX""... $ac_c" 1>&4
-cat > conftest.$ac_ext <<EOF
-#line 722 "configure"
-#include "confdefs.h"
+echo "$as_me:$LINENO: checking for AIX" >&5
+echo $ECHO_N "checking for AIX... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#ifdef _AIX
yes
#endif
-EOF
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "yes" >/dev/null 2>&1; then
- rm -rf conftest*
- echo "$ac_t""yes" 1>&4; cat >> confdefs.h <<\EOF
+ $EGREP "yes" >/dev/null 2>&1; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+cat >>confdefs.h <<\_ACEOF
#define _ALL_SOURCE 1
-EOF
+_ACEOF
else
- rm -rf conftest*
- echo "$ac_t""no" 1>&4
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
rm -f conftest*
-echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&4
-if test -d /etc/conf/kconfig.d &&
- grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
-then
- echo "$ac_t""yes" 1>&4
- ISC=yes # If later tests want to check for ISC.
- cat >> confdefs.h <<\EOF
-#define _POSIX_SOURCE 1
-EOF
+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
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
- if test "$GCC" = yes; then
- CC="$CC -posix"
- else
- CC="$CC -Xp"
- fi
+/* 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>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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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="none required"
else
- echo "$ac_t""no" 1>&4
- ISC=
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
+rm -f conftest.err 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
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-ac_safe=`echo "minix/config.h" | tr './\055' '___'`
-echo $ac_n "checking for minix/config.h""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+/* 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>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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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
- cat > conftest.$ac_ext <<EOF
-#line 769 "configure"
-#include "confdefs.h"
-#include <minix/config.h>
-EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+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
+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
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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
+fi
+rm -f conftest.err 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
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
else
- echo "$ac_err" >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ ac_cv_header_stdc=no
fi
rm -f conftest*
+
fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&4
+
+if test $ac_cv_header_stdc = yes; then
+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+ if test "$cross_compiling" = yes; then
+ :
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.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'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$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'
+ { (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: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f 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
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$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
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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"
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+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
+_ACEOF
+
+fi
+
+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
+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
+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
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <minix/config.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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
+fi
+rm -f conftest.err 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
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <minix/config.h>
+_ACEOF
+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; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_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
+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
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag 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
+ ;;
+ 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: 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 the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_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
+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
+
+fi
+if test $ac_cv_header_minix_config_h = yes; then
MINIX=yes
else
- echo "$ac_t""no" 1>&4
-MINIX=
+ MINIX=
fi
+
if test "$MINIX" = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define _POSIX_SOURCE 1
-EOF
+_ACEOF
+
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define _POSIX_1_SOURCE 2
-EOF
+_ACEOF
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define _MINIX 1
-EOF
+_ACEOF
fi
-echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_prog_cc_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+echo "$as_me:$LINENO: checking for ${CC-cc} option to accept ANSI C" >&5
+echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_prog_cc_stdc=no
ac_save_CFLAGS="$CFLAGS"
@@ -819,222 +3335,416 @@ ac_save_CFLAGS="$CFLAGS"
for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" -Xc
do
CFLAGS="$ac_save_CFLAGS $ac_arg"
- cat > conftest.$ac_ext <<EOF
-#line 824 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#if !defined(__STDC__) || __STDC__ != 1
choke me
-#endif
+#endif
-int main() { return 0; }
-int t() {
+int
+main ()
+{
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
-; return 0; }
-EOF
-if eval $ac_compile; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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_prog_cc_stdc="$ac_arg"; break
-fi
-rm -f conftest*
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
done
CFLAGS="$ac_save_CFLAGS"
fi
-echo "$ac_t""$ac_cv_prog_cc_stdc" 1>&4
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
case "x$ac_cv_prog_cc_stdc" in
x|xno) ;;
*) CC="$CC $ac_cv_prog_cc_stdc" ;;
esac
-echo $ac_n "checking for function prototypes""... $ac_c" 1>&4
+echo "$as_me:$LINENO: checking for function prototypes" >&5
+echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6
if test "$ac_cv_prog_cc_stdc" != no; then
- echo "$ac_t""yes" 1>&4
- cat >> confdefs.h <<\EOF
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ cat >>confdefs.h <<\_ACEOF
#define PROTOTYPES 1
-EOF
+_ACEOF
U= ANSI2KNR=
else
- echo "$ac_t""no" 1>&4
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
U=_ ANSI2KNR=ansi2knr
fi
-echo $ac_n "checking for working const""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_c_const'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- cat > conftest.$ac_ext <<EOF
-#line 873 "configure"
-#include "confdefs.h"
-
-int main() { return 0; }
-int t() {
-
-/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this. */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this. */
-struct point {int x, y;};
-static struct point const zero;
-/* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
-}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
-}
-{ /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
-}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
-}
+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
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset x;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *ccp;
+ char **p;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ ccp = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++ccp;
+ p = (char**) ccp;
+ ccp = (char const *const *) p;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ }
+#endif
-; return 0; }
-EOF
-if eval $ac_compile; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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_c_const=yes
else
- rm -rf conftest*
- ac_cv_c_const=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_c_const=no
fi
-echo "$ac_t""$ac_cv_c_const" 1>&4
+rm -f conftest.err 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
if test $ac_cv_c_const = no; then
- cat >> confdefs.h <<\EOF
-#define const
-EOF
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
fi
-for ac_hdr in limits.h memory.h siginfo.h string.h unistd.h
+
+
+
+
+
+for ac_header in limits.h memory.h siginfo.h string.h unistd.h
do
-ac_safe=`echo "$ac_hdr" | tr './\055' '___'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- cat > conftest.$ac_ext <<EOF
-#line 950 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=yes"
-else
- echo "$ac_err" >&5
- rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
-fi
-rm -f conftest*
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+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
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&4
- ac_tr_hdr=HAVE_`echo $ac_hdr | tr '[a-z]./\055' '[A-Z]___'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_hdr 1
-EOF
-
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
- echo "$ac_t""no" 1>&4
-fi
-done
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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
-# If we cannot run a trivial program, we must be cross compiling.
-echo $ac_n "checking whether cross-compiling""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_c_cross'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+ac_header_compiler=no
+fi
+rm -f conftest.err 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
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (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; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
+ else
+ ac_cpp_err=
+ fi
else
- if test "$cross_compiling" = yes; then
- ac_cv_cross=yes
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
else
-cat > conftest.$ac_ext <<EOF
-#line 987 "configure"
-#include "confdefs.h"
-main(){return(0);}
-EOF
-eval $ac_link
-if test -s conftest && (./conftest; exit) 2>/dev/null; then
- ac_cv_c_cross=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+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: )
+ { 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
+ ;;
+ 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: 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 the AC_PACKAGE_NAME lists. ##
+## ------------------------------------------ ##
+_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 eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_c_cross=yes
+ eval "$as_ac_Header=\$ac_header_preproc"
fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
fi
-rm -fr conftest*
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
fi
-cross_compiling=$ac_cv_c_cross
-echo "$ac_t""$ac_cv_c_cross" 1>&4
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_header_stdc'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+done
+
+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 <<EOF
-#line 1008 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <float.h>
-EOF
-eval "$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-ac_err=`grep -v '^ *+' conftest.out`
-if test -z "$ac_err"; then
- rm -rf conftest*
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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 "$ac_err" >&5
- rm -rf conftest*
- ac_cv_header_stdc=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
fi
-rm -f conftest*
+rm -f conftest.err 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 <<EOF
-#line 1030 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <string.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
+ $EGREP "memchr" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
@@ -1043,16 +3753,19 @@ 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 <<EOF
-#line 1048 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
+ $EGREP "free" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
@@ -1061,419 +3774,624 @@ fi
if test $ac_cv_header_stdc = yes; then
# /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-if test "$cross_compiling" = yes; then
- ac_cv_header_stdc=no
+ if test "$cross_compiling" = yes; then
+ :
else
-cat > conftest.$ac_ext <<EOF
-#line 1069 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <ctype.h>
-#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
-int main () { int i; for (i = 0; i < 256; i++)
-if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
-exit (0); }
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
-EOF
-eval $ac_link
-if test -s conftest && (./conftest; exit) 2>/dev/null; then
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+ int i;
+ for (i = 0; i < 256; i++)
+ if (XOR (islower (i), ISLOWER (i))
+ || toupper (i) != TOUPPER (i))
+ exit(2);
+ exit (0);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$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'
+ { (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
- ac_cv_header_stdc=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-rm -fr conftest*
fi
fi
-echo "$ac_t""$ac_cv_header_stdc" 1>&4
+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 <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define STDC_HEADERS 1
-EOF
+_ACEOF
fi
-echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_type_signal'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+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 <<EOF
-#line 1103 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
#include <signal.h>
#ifdef signal
-#undef signal
+# undef signal
+#endif
+#ifdef __cplusplus
+extern "C" void (*signal (int, void (*)(int)))(int);
+#else
+void (*signal ()) ();
#endif
-extern void (*signal ()) ();
-int main() { return 0; }
-int t() {
+
+int
+main ()
+{
int i;
-; return 0; }
-EOF
-if eval $ac_compile; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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_signal=void
else
- rm -rf conftest*
- ac_cv_type_signal=int
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_signal=int
fi
-echo "$ac_t""$ac_cv_type_signal" 1>&4
-cat >> confdefs.h <<EOF
+rm -f conftest.err 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
+
+cat >>confdefs.h <<_ACEOF
#define RETSIGTYPE $ac_cv_type_signal
-EOF
+_ACEOF
-echo $ac_n "checking for size_t""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_type_size_t'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+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 <<EOF
-#line 1137 "configure"
-#include "confdefs.h"
-#include <sys/types.h>
-#if STDC_HEADERS
-#include <stdlib.h>
-#endif
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "size_t" >/dev/null 2>&1; then
- rm -rf conftest*
+ 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 ()
+{
+if ((size_t *) 0)
+ return 0;
+if (sizeof (size_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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_size_t=yes
else
- rm -rf conftest*
- ac_cv_type_size_t=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_size_t=no
+fi
+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$ac_t""$ac_cv_type_size_t" 1>&4
-if test $ac_cv_type_size_t = no; then
- cat >> confdefs.h <<\EOF
+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
-EOF
+_ACEOF
fi
+
+
+
+
+
+
+
for ac_func in mkstemp sigaction sigaltstack sigstack sigvec strerror tmpfile
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- cat > conftest.$ac_ext <<EOF
-#line 1171 "configure"
-#include "confdefs.h"
-#include <ctype.h> /* Arbitrary system header to define __stub macros. */
-/* Override any gcc2 internal prototype to avoid an error. */
-char $ac_func();
+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 eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-int main() { return 0; }
-int t() {
+#undef $ac_func
+/* 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)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if eval $ac_link; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+eval "$as_ac_var=no"
fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&4
- ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&4
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+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
+
fi
done
# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
# for constant arguments. Useless!
-echo $ac_n "checking for working alloca.h""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_header_alloca_h'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+echo "$as_me:$LINENO: checking for working alloca.h" >&5
+echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6
+if test "${ac_cv_working_alloca_h+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1220 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <alloca.h>
-int main() { return 0; }
-int t() {
-char *p = alloca(2 * sizeof(int));
-; return 0; }
-EOF
-if eval $ac_link; then
- rm -rf conftest*
- ac_cv_header_alloca_h=yes
-else
- rm -rf conftest*
- ac_cv_header_alloca_h=no
-fi
-rm -f conftest*
+int
+main ()
+{
+char *p = (char *) alloca (2 * sizeof (int));
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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_working_alloca_h=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_working_alloca_h=no
fi
-echo "$ac_t""$ac_cv_header_alloca_h" 1>&4
-if test $ac_cv_header_alloca_h = yes; then
- cat >> confdefs.h <<\EOF
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
+echo "${ECHO_T}$ac_cv_working_alloca_h" >&6
+if test $ac_cv_working_alloca_h = yes; then
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_ALLOCA_H 1
-EOF
+_ACEOF
fi
-echo $ac_n "checking for alloca""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_func_alloca'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+echo "$as_me:$LINENO: checking for alloca" >&5
+echo $ECHO_N "checking for alloca... $ECHO_C" >&6
+if test "${ac_cv_func_alloca_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1251 "configure"
-#include "confdefs.h"
-
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#ifdef __GNUC__
# define alloca __builtin_alloca
#else
-# if HAVE_ALLOCA_H
-# include <alloca.h>
+# ifdef _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
# else
-# ifdef _AIX
- #pragma alloca
+# if HAVE_ALLOCA_H
+# include <alloca.h>
# else
-# ifndef alloca /* predefined by HP cc +Olibcalls */
+# ifdef _AIX
+ #pragma alloca
+# else
+# ifndef alloca /* predefined by HP cc +Olibcalls */
char *alloca ();
+# endif
# endif
# endif
# endif
#endif
-int main() { return 0; }
-int t() {
-char *p = (char *) alloca(1);
-; return 0; }
-EOF
-if eval $ac_link; then
- rm -rf conftest*
- ac_cv_func_alloca=yes
+int
+main ()
+{
+char *p = (char *) alloca (1);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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_func_alloca_works=yes
else
- rm -rf conftest*
- ac_cv_func_alloca=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_func_alloca_works=no
fi
-echo "$ac_t""$ac_cv_func_alloca" 1>&4
-if test $ac_cv_func_alloca = yes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_ALLOCA 1
-EOF
-
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
+echo "${ECHO_T}$ac_cv_func_alloca_works" >&6
+
+if test $ac_cv_func_alloca_works = yes; then
-if test $ac_cv_func_alloca = no; then
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_ALLOCA 1
+_ACEOF
+
+else
# The SVR3 libPW and SVR4 libucb both contain incompatible functions
- # that cause trouble. Some versions do not even contain alloca or
- # contain a buggy version. If you still want to use their alloca,
- # use ar to extract alloca.o from them instead of compiling alloca.c.
- ALLOCA=alloca.o
- cat >> confdefs.h <<\EOF
+# that cause trouble. Some versions do not even contain alloca or
+# contain a buggy version. If you still want to use their alloca,
+# use ar to extract alloca.o from them instead of compiling alloca.c.
+
+ALLOCA=alloca.$ac_objext
+
+cat >>confdefs.h <<\_ACEOF
#define C_ALLOCA 1
-EOF
+_ACEOF
-echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_os_cray'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
+echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6
+if test "${ac_cv_os_cray+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1309 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#if defined(CRAY) && ! defined(CRAY2)
webecray
#else
wenotbecray
#endif
-EOF
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "webecray" >/dev/null 2>&1; then
- rm -rf conftest*
+ $EGREP "webecray" >/dev/null 2>&1; then
ac_cv_os_cray=yes
else
- rm -rf conftest*
ac_cv_os_cray=no
fi
rm -f conftest*
fi
-echo "$ac_t""$ac_cv_os_cray" 1>&4
+echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
+echo "${ECHO_T}$ac_cv_os_cray" >&6
if test $ac_cv_os_cray = yes; then
-echo $ac_n "checking for _getb67""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_func__getb67'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- cat > conftest.$ac_ext <<EOF
-#line 1336 "configure"
-#include "confdefs.h"
-#include <ctype.h> /* Arbitrary system header to define __stub macros. */
-/* Override any gcc2 internal prototype to avoid an error. */
-char _getb67();
-
-int main() { return 0; }
-int t() {
-
-/* 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__getb67) || defined (__stub____getb67)
-choke me
-#else
-_getb67();
-#endif
-
-; return 0; }
-EOF
-if eval $ac_link; then
- rm -rf conftest*
- eval "ac_cv_func__getb67=yes"
-else
- rm -rf conftest*
- eval "ac_cv_func__getb67=no"
-fi
-rm -f conftest*
-
-fi
-if eval "test \"`echo '$ac_cv_func_'_getb67`\" = yes"; then
- echo "$ac_t""yes" 1>&4
- cat >> confdefs.h <<\EOF
-#define CRAY_STACKSEG_END _getb67
-EOF
-
+ for ac_func in _getb67 GETB67 getb67; 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 eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&4
-echo $ac_n "checking for GETB67""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_func_GETB67'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- cat > conftest.$ac_ext <<EOF
-#line 1379 "configure"
-#include "confdefs.h"
-#include <ctype.h> /* Arbitrary system header to define __stub macros. */
-/* Override any gcc2 internal prototype to avoid an error. */
-char GETB67();
-
-int main() { return 0; }
-int t() {
-
-/* 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_GETB67) || defined (__stub___GETB67)
-choke me
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
#else
-GETB67();
+# include <assert.h>
#endif
-; return 0; }
-EOF
-if eval $ac_link; then
- rm -rf conftest*
- eval "ac_cv_func_GETB67=yes"
-else
- rm -rf conftest*
- eval "ac_cv_func_GETB67=no"
-fi
-rm -f conftest*
+#undef $ac_func
-fi
-if eval "test \"`echo '$ac_cv_func_'GETB67`\" = yes"; then
- echo "$ac_t""yes" 1>&4
- cat >> confdefs.h <<\EOF
-#define CRAY_STACKSEG_END GETB67
-EOF
-
-else
- echo "$ac_t""no" 1>&4
-echo $ac_n "checking for getb67""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_func_getb67'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- cat > conftest.$ac_ext <<EOF
-#line 1422 "configure"
-#include "confdefs.h"
-#include <ctype.h> /* Arbitrary system header to define __stub macros. */
/* Override any gcc2 internal prototype to avoid an error. */
-char getb67();
-
-int main() { return 0; }
-int t() {
-
+#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_getb67) || defined (__stub___getb67)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-getb67();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if eval $ac_link; then
- rm -rf conftest*
- eval "ac_cv_func_getb67=yes"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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
- rm -rf conftest*
- eval "ac_cv_func_getb67=no"
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+eval "$as_ac_var=no"
fi
-if eval "test \"`echo '$ac_cv_func_'getb67`\" = yes"; then
- echo "$ac_t""yes" 1>&4
- cat >> confdefs.h <<\EOF
-#define CRAY_STACKSEG_END getb67
-EOF
-
-else
- echo "$ac_t""no" 1>&4
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+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
-fi
+cat >>confdefs.h <<_ACEOF
+#define CRAY_STACKSEG_END $ac_func
+_ACEOF
+ break
fi
+ done
fi
-echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_c_stack_direction'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
+echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6
+if test "${ac_cv_c_stack_direction+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test "$cross_compiling" = yes; then
ac_cv_c_stack_direction=0
else
-cat > conftest.$ac_ext <<EOF
-#line 1476 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+int
find_stack_direction ()
{
static char *addr = 0;
@@ -1486,228 +4404,478 @@ find_stack_direction ()
else
return (&dummy > addr) ? 1 : -1;
}
+
+int
main ()
{
- exit (find_stack_direction() < 0);
+ exit (find_stack_direction () < 0);
}
-EOF
-eval $ac_link
-if test -s conftest && (./conftest; exit) 2>/dev/null; then
+_ACEOF
+rm -f 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='./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_c_stack_direction=1
else
- ac_cv_c_stack_direction=-1
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_stack_direction=-1
fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-rm -fr conftest*
fi
-echo "$ac_t""$ac_cv_c_stack_direction" 1>&4
-cat >> confdefs.h <<EOF
+echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
+echo "${ECHO_T}$ac_cv_c_stack_direction" >&6
+
+cat >>confdefs.h <<_ACEOF
#define STACK_DIRECTION $ac_cv_c_stack_direction
-EOF
+_ACEOF
+
fi
-echo $ac_n "checking for vprintf""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_func_vprintf'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+
+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 eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1516 "configure"
-#include "confdefs.h"
-#include <ctype.h> /* Arbitrary system header to define __stub macros. */
-/* Override any gcc2 internal prototype to avoid an error. */
-char vprintf();
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-int main() { return 0; }
-int t() {
+#undef $ac_func
+/* 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_vprintf) || defined (__stub___vprintf)
+#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
-vprintf();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if eval $ac_link; then
- rm -rf conftest*
- eval "ac_cv_func_vprintf=yes"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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
- rm -rf conftest*
- eval "ac_cv_func_vprintf=no"
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+eval "$as_ac_var=no"
fi
-if eval "test \"`echo '$ac_cv_func_'vprintf`\" = yes"; then
- echo "$ac_t""yes" 1>&4
- cat >> confdefs.h <<\EOF
-#define HAVE_VPRINTF 1
-EOF
-
-else
- echo "$ac_t""no" 1>&4
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-
-if test "$ac_cv_func_vprintf" != yes; then
-echo $ac_n "checking for _doprnt""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_func__doprnt'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
+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
+if test "${ac_cv_func__doprnt+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1562 "configure"
-#include "confdefs.h"
-#include <ctype.h> /* Arbitrary system header to define __stub macros. */
-/* Override any gcc2 internal prototype to avoid an error. */
-char _doprnt();
+ cat >conftest.$ac_ext <<_ACEOF
+/* 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
-int main() { return 0; }
-int t() {
+#undef _doprnt
+/* 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)
choke me
#else
-_doprnt();
+char (*f) () = _doprnt;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if eval $ac_link; then
- rm -rf conftest*
- eval "ac_cv_func__doprnt=yes"
+int
+main ()
+{
+return f != _doprnt;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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_func__doprnt=yes
else
- rm -rf conftest*
- eval "ac_cv_func__doprnt=no"
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_func__doprnt=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
-if eval "test \"`echo '$ac_cv_func_'_doprnt`\" = yes"; then
- echo "$ac_t""yes" 1>&4
- cat >> confdefs.h <<\EOF
+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
#define HAVE_DOPRNT 1
-EOF
+_ACEOF
-else
- echo "$ac_t""no" 1>&4
fi
fi
+done
+
+
for ac_func in strtol
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- cat > conftest.$ac_ext <<EOF
-#line 1611 "configure"
-#include "confdefs.h"
-#include <ctype.h> /* Arbitrary system header to define __stub macros. */
-/* Override any gcc2 internal prototype to avoid an error. */
-char $ac_func();
+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 eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-int main() { return 0; }
-int t() {
+#undef $ac_func
+/* 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)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if eval $ac_link; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+eval "$as_ac_var=no"
fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&4
- :
-else
- echo "$ac_t""no" 1>&4
-LIBOBJS="$LIBOBJS ${ac_func}.o"
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
+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" | \
+ *" $ac_func.$ac_objext" | \
+ "$ac_func.$ac_objext "* | \
+ *" $ac_func.$ac_objext "* ) ;;
+ *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" ;;
+esac
+
+fi
done
-echo $ac_n "checking ecvt declaration""... $ac_c" 1>&4
-cat > conftest.$ac_ext <<EOF
-#line 1653 "configure"
-#include "confdefs.h"
+
+echo "$as_me:$LINENO: checking ecvt declaration" >&5
+echo $ECHO_N "checking ecvt declaration... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "ecvt" >/dev/null 2>&1; then
- rm -rf conftest*
- echo "$ac_t""yes" 1>&4; cat >> confdefs.h <<\EOF
+ $EGREP "ecvt" >/dev/null 2>&1; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; cat >>confdefs.h <<\_ACEOF
#define HAVE_EFGCVT 2
-EOF
+_ACEOF
else
- rm -rf conftest*
- echo "$ac_t""no" 1>&4; for ac_func in ecvt
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6;
+for ac_func in ecvt
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&4
-if eval "test \"`echo '${'ac_cv_func_$ac_func'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&4
-else
- cat > conftest.$ac_ext <<EOF
-#line 1673 "configure"
-#include "confdefs.h"
-#include <ctype.h> /* Arbitrary system header to define __stub macros. */
-/* Override any gcc2 internal prototype to avoid an error. */
-char $ac_func();
+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 eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
-int main() { return 0; }
-int t() {
+#undef $ac_func
+/* 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)
choke me
#else
-$ac_func();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if eval $ac_link; then
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=yes"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+eval "$as_ac_var=no"
fi
-if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
- echo "$ac_t""yes" 1>&4
- ac_tr_func=HAVE_`echo $ac_func | tr '[a-z]' '[A-Z]'`
- cat >> confdefs.h <<EOF
-#define $ac_tr_func 1
-EOF
-
-else
- echo "$ac_t""no" 1>&4
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+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
+
fi
done
@@ -1715,7 +4883,8 @@ fi
rm -f conftest*
-echo $ac_n "checking if stack overflow is detectable""... $ac_c" 1>&4
+echo "$as_me:$LINENO: checking if stack overflow is detectable" >&5
+echo $ECHO_N "checking if stack overflow is detectable... $ECHO_C" >&6
# Code from Jim Avera <jima@netcom.com>.
# stackovf.c requires:
# 1. Either sigaction with SA_ONSTACK, or sigvec with SV_ONSTACK
@@ -1724,400 +4893,1426 @@ echo $ac_n "checking if stack overflow is detectable""... $ac_c" 1>&4
use_stackovf=no
if test "$ac_cv_func_sigaction" = yes || test "$ac_cv_func_sigvec" = yes; then
if test "$ac_cv_func_sigaltstack" = yes || test "$ac_cv_func_sigstack" = yes; then
- cat > conftest.$ac_ext <<EOF
-#line 1729 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/time.h>
#include <sys/resource.h>
#include <signal.h>
-int main() { return 0; }
-int t() {
+int
+main ()
+{
struct rlimit r; int i; getrlimit (RLIMIT_STACK, &r)
#if (!defined(HAVE_SIGACTION) || !defined(SA_ONSTACK)) \
&& (!defined(HAVE_SIGVEC) || !defined(SV_ONSTACK))
choke me /* SA_ONSTACK and/or SV_ONSTACK are not defined */
#endif
-; return 0; }
-EOF
-if eval $ac_link; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 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); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (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); }; } &&
+ { 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
use_stackovf=yes
-fi
-rm -f conftest*
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
fi
-echo "$ac_t""$use_stackovf" 1>&4
+echo "$as_me:$LINENO: result: $use_stackovf" >&5
+echo "${ECHO_T}$use_stackovf" >&6
if test "$use_stackovf" = yes; then
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define USE_STACKOVF 1
-EOF
+_ACEOF
STACKOVF=stackovf.${U}o
-
- cat > conftest.$ac_ext <<EOF
-#line 1760 "configure"
-#include "confdefs.h"
+
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/resource.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "rlim_t" >/dev/null 2>&1; then
+ $EGREP "rlim_t" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define rlim_t int
-EOF
+_ACEOF
fi
rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 1777 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <signal.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "stack_t" >/dev/null 2>&1; then
+ $EGREP "stack_t" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
- cat >> confdefs.h <<\EOF
+ cat >>confdefs.h <<\_ACEOF
#define stack_t struct sigaltstack
-EOF
+_ACEOF
fi
rm -f conftest*
- cat > conftest.$ac_ext <<EOF
-#line 1794 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <signal.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "sigcontext" >/dev/null 2>&1; then
- rm -rf conftest*
- cat >> confdefs.h <<\EOF
+ $EGREP "sigcontext" >/dev/null 2>&1; then
+ cat >>confdefs.h <<\_ACEOF
#define HAVE_SIGCONTEXT 1
-EOF
+_ACEOF
fi
rm -f conftest*
fi
-echo $ac_n "checking if changeword is wanted""... $ac_c" 1>&4
+echo "$as_me:$LINENO: checking if changeword is wanted" >&5
+echo $ECHO_N "checking if changeword is wanted... $ECHO_C" >&6
# Check whether --enable-changeword or --disable-changeword was given.
-enableval="$enable_changeword"
-if test -n "$enableval"; then
+if test "${enable_changeword+set}" = set; then
+ enableval="$enable_changeword"
if test "$enableval" = yes; then
- echo "$ac_t""yes" 1>&4
- cat >> confdefs.h <<\EOF
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ cat >>confdefs.h <<\_ACEOF
#define ENABLE_CHANGEWORD 1
-EOF
+_ACEOF
else
- echo "$ac_t""no" 1>&4
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
else
- echo "$ac_t""no" 1>&4
-fi
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi;
+echo "$as_me:$LINENO: checking if malloc debugging is wanted" >&5
+echo $ECHO_N "checking if malloc debugging is wanted... $ECHO_C" >&6
-echo $ac_n "checking if malloc debugging is wanted""... $ac_c" 1>&4
# Check whether --with-dmalloc or --without-dmalloc was given.
-withval="$with_dmalloc"
-if test -n "$withval"; then
+if test "${with_dmalloc+set}" = set; then
+ withval="$with_dmalloc"
if test "$withval" = yes; then
- echo "$ac_t""yes" 1>&4
- cat >> confdefs.h <<\EOF
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ cat >>confdefs.h <<\_ACEOF
#define WITH_DMALLOC 1
-EOF
+_ACEOF
LIBS="$LIBS -ldmalloc"
LDFLAGS="$LDFLAGS -g"
else
- echo "$ac_t""no" 1>&4
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
else
- echo "$ac_t""no" 1>&4
-fi
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi;
-
-trap '' 1 2 15
-if test -w $cache_file; then
-echo "updating cache $cache_file"
-cat > $cache_file <<\EOF
+ ac_config_files="$ac_config_files Makefile doc/Makefile lib/Makefile src/Makefile checks/Makefile examples/Makefile"
+ ac_config_commands="$ac_config_commands default"
+cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
-# scripts and configure runs. It is not useful on other systems.
-# If it contains results you don't want to keep, you may remove or edit it.
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems. If it contains results you don't
+# want to keep, you may remove or edit it.
#
-# By default, configure uses ./config.cache as the cache file,
-# creating it if it does not exist already. You can give configure
-# the --cache-file=FILE option to use a different cache file; that is
-# what configure does when it calls configure scripts in
-# subdirectories, so they share the cache.
-# Giving --cache-file=/dev/null disables caching, for debugging configure.
-# config.status only pays attention to the cache file if you give it the
-# --recheck option to rerun configure.
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
#
-EOF
-# Ultrix sh set writes to stderr and can't be redirected directly.
-(set) 2>&1 |
- sed -n "s/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/: \${\1='\2'}/p" \
- >> $cache_file
-else
-echo "not updating unwritable cache $cache_file"
-fi
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
-trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+{
+ (set) 2>&1 |
+ case `(ac_space=' '; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ # `set' does not quote correctly, so add quotes (double-quote
+ # substitution turns \\\\ into \\, and sed turns \\ into \).
+ sed -n \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if 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 "not updating unwritable cache $cache_file"
+ fi
+fi
+rm -f confcache
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-# Any assignment to VPATH causes Sun make to only execute
-# the first set of double-colon rules, so remove it if not needed.
-# If there is a colon in the path, we need to keep it.
+# 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[ ]*=[^:]*$/d'
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
fi
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
DEFS=-DHAVE_CONFIG_H
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
+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_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
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#!/bin/sh
-# Generated automatically by configure.
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
# Run this file to recreate the current configuration.
-# This directory was configured as follows,
-# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-#
-# $0 $ac_configure_args
-#
# Compiler output produced by configure, useful for debugging
-# configure, is in ./config.log if it exists.
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# 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+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+DUALCASE=1; export DUALCASE # for MKS sh
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
do
- case "\$ac_option" in
- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
- echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
- exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
- -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.1"
- exit 0 ;;
- -help | --help | --hel | --he | --h)
- echo "\$ac_cs_usage"; exit 0 ;;
- *) echo "\$ac_cs_usage"; exit 1 ;;
- esac
+ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
done
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
+# Required to use basename.
+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
+ as_basename=basename
+else
+ as_basename=false
+fi
+
-trap 'rm -fr Makefile doc/Makefile lib/Makefile src/Makefile \
-checks/Makefile examples/Makefile config.h conftest*; exit 1' 1 2 15
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# 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
-# Protect against being on the right side of a sed subst in config.status.
-sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\\\&%]/\\\\&/g;
- s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
-$ac_vpsub
-$extrasub
-s%@CFLAGS@%$CFLAGS%g
-s%@CPPFLAGS@%$CPPFLAGS%g
-s%@CXXFLAGS@%$CXXFLAGS%g
-s%@DEFS@%$DEFS%g
-s%@LDFLAGS@%$LDFLAGS%g
-s%@LIBS@%$LIBS%g
-s%@exec_prefix@%$exec_prefix%g
-s%@prefix@%$prefix%g
-s%@program_transform_name@%$program_transform_name%g
-s%@PRODUCT@%$PRODUCT%g
-s%@VERSION@%$VERSION%g
-s%@AWK@%$AWK%g
-s%@CC@%$CC%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@RANLIB@%$RANLIB%g
-s%@CPP@%$CPP%g
-s%@U@%$U%g
-s%@ANSI2KNR@%$ANSI2KNR%g
-s%@ALLOCA@%$ALLOCA%g
-s%@LIBOBJS@%$LIBOBJS%g
-s%@STACKOVF@%$STACKOVF%g
-CEOF
-EOF
-cat >> $CONFIG_STATUS <<EOF
-
-CONFIG_FILES=\${CONFIG_FILES-"Makefile doc/Makefile lib/Makefile src/Makefile \
-checks/Makefile examples/Makefile"}
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
+ 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$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
- # Adjust relative srcdir, etc. for subdirectories.
+ # 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 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
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ 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 sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+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
- # Remove last slash and all that follows it. Not all systems have dirname.
- ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
- if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
- # The file is in a subdirectory.
- test ! -d "$ac_dir" && mkdir "$ac_dir"
- ac_dir_suffix="/$ac_dir"
- # A "../" for each directory in $ac_dir_suffix.
- ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
else
- ac_dir_suffix= ac_dots=
+ as_ln_s='ln -s'
fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
- case "$ac_given_srcdir" in
- .) srcdir=.
- if test -z "$ac_dots"; then top_srcdir=.
- else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
- /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
- *) # Relative path.
- srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
- top_srcdir="$ac_dots$ac_given_srcdir" ;;
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ test -d ./-p && rmdir ./-p
+ as_mkdir_p=false
+fi
+
+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'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval 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
+
+# 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. 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.59. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -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
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+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.59,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2003 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ 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 | --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
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { 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" ;;
+
+ esac
+ shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ 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
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
+ "lib/Makefile" ) CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
+ "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+ "checks/Makefile" ) CONFIG_FILES="$CONFIG_FILES checks/Makefile" ;;
+ "examples/Makefile" ) CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
+ "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
+ "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
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$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
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+#
+# 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
+ # 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,@PRODUCT@,$PRODUCT,;t t
+s,@VERSION@,$VERSION,;t t
+s,@AWK@,$AWK,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@U@,$U,;t t
+s,@ANSI2KNR@,$ANSI2KNR,;t t
+s,@ALLOCA@,$ALLOCA,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@STACKOVF@,$STACKOVF,;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
+fi # test -n "$CONFIG_FILES"
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+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
- echo creating "$ac_file"
- rm -f "$ac_file"
- configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
- case "$ac_file" in
- *Makefile*) ac_comsub="1i\\
-# $configure_input" ;;
- *) ac_comsub= ;;
+
+ # 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 ||
+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; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # 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
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ 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 ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
esac
- sed -e "$ac_comsub
-s%@configure_input@%$configure_input%g
-s%@srcdir@%$srcdir%g
-s%@top_srcdir@%$top_srcdir%g
-s%@INSTALL@%$INSTALL%g
-" -f conftest.subs $ac_given_srcdir/$ac_file_in > $ac_file
-fi; done
-rm -f conftest.subs
+
+ 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
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+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='\3'
-ac_dD='%g'
-# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
-ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='\([ ]\)%\1#\2define\3'
+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='\4%g'
-# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_eB='$%\1#\2define\3'
-ac_eC=' '
-ac_eD='%g'
-
-CONFIG_HEADERS=${CONFIG_HEADERS-"config.h"}
-for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
- # Support "outfile[:infile]", defaulting infile="outfile.in".
- case "$ac_file" in
- *:*) ac_file_in=`echo "$ac_file"|sed 's%.*:%%'`
- ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
- *) ac_file_in="${ac_file}.in" ;;
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- echo creating $ac_file
-
- rm -f conftest.frag conftest.in conftest.out
- cp $ac_given_srcdir/$ac_file_in conftest.in
-
-EOF
-
-# Transform confdefs.h into a sed script conftest.vals that substitutes
-# the proper values into config.h.in to produce config.h. 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.vals
-cat > conftest.hdr <<\EOF
-s/[\\&%]/\\&/g
-s%[\\$`]%\\&%g
-s%#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
-s%ac_d%ac_u%gp
-s%ac_u%ac_e%gp
-EOF
-sed -n -f conftest.hdr confdefs.h > conftest.vals
-rm -f conftest.hdr
+ 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; }; }
+ # Do quote $f, to prevent DOS paths from being IFS'd.
+ 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.
-cat >> conftest.vals <<\EOF
-s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
-EOF
-
-# Break up conftest.vals because some shells have a limit on
-# the size of here documents, and old seds have small limits too.
-# Maximum number of lines to put in a single here document.
-ac_max_here_lines=12
+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 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 $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # 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 :
+while grep . conftest.undefs >/dev/null
do
- ac_lines=`grep -c . conftest.vals`
- # grep -c gives empty output for an empty file on some AIX systems.
- if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
- # Write a limited-size here document to conftest.frag.
- echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+ # 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 conftest.frag conftest.in > conftest.out
- rm -f conftest.in
- mv conftest.out conftest.in
-' >> $CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
- rm -f conftest.vals
- mv conftest.tail conftest.vals
+ 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.vals
-
-cat >> $CONFIG_STATUS <<\EOF
- rm -f conftest.frag conftest.h
- echo "/* $ac_file. Generated automatically by configure. */" > conftest.h
- cat conftest.in >> conftest.h
- rm -f conftest.in
- if cmp -s $ac_file conftest.h 2>/dev/null; then
- echo "$ac_file is unchanged"
- rm -f conftest.h
+rm -f conftest.undefs
+
+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
- rm -f $ac_file
- mv conftest.h $ac_file
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
fi
-fi; done
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; 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
+ fi
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
+ fi
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ 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; }; }; }
+
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # 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
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ 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 ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+
+# Do not use `cd foo && pwd` to compute absolute paths, because
+# the directories may not exist.
+case `pwd` in
+.) ac_abs_builddir="$ac_dir";;
+*)
+ case "$ac_dir" in
+ .) ac_abs_builddir=`pwd`;;
+ [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
+ *) ac_abs_builddir=`pwd`/"$ac_dir";;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_builddir=${ac_top_builddir}.;;
+*)
+ case ${ac_top_builddir}. in
+ .) ac_abs_top_builddir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
+ *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_srcdir=$ac_srcdir;;
+*)
+ case $ac_srcdir in
+ .) ac_abs_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
+ *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
+ esac;;
+esac
+case $ac_abs_builddir in
+.) ac_abs_top_srcdir=$ac_top_srcdir;;
+*)
+ case $ac_top_srcdir in
+ .) ac_abs_top_srcdir=$ac_abs_builddir;;
+ [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
+ *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
+ esac;;
+esac
-test -z "$CONFIG_HEADERS" || date > stamp-h
-exit 0
-EOF
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ default ) test -z "$CONFIG_HEADERS" || date > stamp-h ;;
+ esac
+done
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
diff --git a/configure.in b/configure.in
index 4db026fa..d7410abf 100644
--- a/configure.in
+++ b/configure.in
@@ -1,15 +1,13 @@
# Configure template for GNU m4.
-# Copyright (C) 1991, 1993, 1994 Free Software Foundation, Inc.
+# Copyright (C) 1991, 1993, 1994, 2004 Free Software Foundation, Inc.
# Process this file with autoconf to produce a configure script.
-undefine([changeword])
-
AC_INIT(src/m4.c)
AC_CONFIG_HEADER(config.h)
AC_ARG_PROGRAM
PRODUCT=m4
-VERSION=1.4
+VERSION=1.4.1
AC_DEFINE_UNQUOTED(PRODUCT, "$PRODUCT")
AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
AC_SUBST(PRODUCT)
diff --git a/doc/Makefile.in b/doc/Makefile.in
index d0e15763..164d8cc9 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -1,5 +1,5 @@
# Makefile for GNU m4 documentation.
-# Copyright (C) 1994 Free Software Foundation, Inc.
+# Copyright (C) 1994, 2004 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -33,7 +33,7 @@ infodir = $(prefix)/info
.SUFFIXES:
DISTFILES = Makefile.in m4.texinfo texinfo.tex \
-stamp-vti version.texi m4.info m4.info-1 m4.info-2 m4.info-3
+stamp-vti version.texi m4.info
all: m4.info
diff --git a/doc/m4.info b/doc/m4.info
index d3db9c3e..9b66a7e7 100644
--- a/doc/m4.info
+++ b/doc/m4.info
@@ -1,5 +1,4 @@
-This is Info file m4.info, produced by Makeinfo-1.55 from the input
-file m4.texinfo.
+This is m4.info, produced by makeinfo version 4.7 from m4.texinfo.
START-INFO-DIR-ENTRY
* m4: (m4). A powerful macro processor.
@@ -7,7 +6,7 @@ END-INFO-DIR-ENTRY
This file documents the GNU `m4' utility.
- Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994 Free Software
+ Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004 Free Software
Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
@@ -25,88 +24,3176 @@ versions, except that this permission notice may be stated in a
translation approved by the Foundation.

-Indirect:
-m4.info-1: 959
-m4.info-2: 50733
-m4.info-3: 97497
+File: m4.info, Node: Top, Next: Preliminaries, Prev: (dir), Up: (dir)
+
+GNU `m4'
+********
+
+GNU `m4' is an implementation of the traditional UNIX macro processor.
+It is mostly SVR4 compatible, although it has some extensions (for
+example, handling more than 9 positional parameters to macros). `m4'
+also has builtin functions for including files, running shell commands,
+doing arithmetic, etc. Autoconf needs GNU `m4' for generating
+`configure' scripts, but not for running them.
+
+ GNU `m4' was originally written by Rene' Seindal, with subsequent
+changes by Franc,ois Pinard and other volunteers on the Internet. All
+names and email addresses can be found in the file `THANKS' from the
+GNU `m4' distribution.
+
+ This is release 1.4.1. It is now to be considered stable, future
+releases are only meant to fix bugs, increase speed, or improve
+documentation. However...
+
+ An experimental feature, which would improve `m4' usefulness, allows
+for changing the syntax for what is a "word" in `m4'. You should use:
+ ./configure --enable-changeword
+ if you want this feature compiled in. The current implementation
+slows down `m4' considerably and is hardly acceptable. So, it might go
+away, do not count on it yet.
+
+* Menu:
+
+* Preliminaries:: Introduction and preliminaries
+* Syntax:: Lexical and syntactic conventions
+
+* Macros:: How to invoke macros
+* Definitions:: How to define new macros
+* Conditionals:: Conditionals and loops
+
+* Debugging:: How to debug macros and input
+
+* Input Control:: Input control
+* File Inclusion:: File inclusion
+* Diversions:: Diverting and undiverting output
+
+* Text handling:: Macros for text handling
+* Arithmetic:: Macros for doing arithmetic
+* UNIX commands:: Macros for running UNIX commands
+* Miscellaneous:: Miscellaneous builtin macros
+* Frozen files:: Fast loading of frozen states
+
+* Compatibility:: Compatibility with other versions of m4
+* Concept index:: Index for many concepts
+* Macro index:: Index for all m4 macros
+
+ --- The Detailed Node Listing ---
+
+Introduction and preliminaries
+
+* Intro:: Introduction to `m4'
+* History:: Historical references
+
+* Invoking m4:: Invoking `m4'
+* Bugs:: Problems and bugs
+* Manual:: Using this manual
+
+Lexical and syntactic conventions
+
+* Names:: Macro names
+* Quoted strings:: Quoting input to m4
+* Other tokens:: Other kinds of input tokens
+* Comments:: Comments in m4 input
+
+How to invoke macros
+
+* Invocation:: Macro invocation
+* Inhibiting Invocation:: Preventing macro invocation
+* Macro Arguments:: Macro arguments
+* Quoting Arguments:: On Quoting Arguments to macros
+* Macro expansion:: Expanding macros
+
+How to define new macros
+
+* Define:: Defining a new macro
+* Arguments:: Arguments to macros
+* Pseudo Arguments:: Pseudo arguments to macros
+* Undefine:: Deleting a macro
+* Defn:: Renaming macros
+* Pushdef:: Temporarily redefining macros
+
+* Indir:: Indirect call of macros
+* Builtin:: Indirect call of builtins
+
+Conditionals, loops and recursion
+
+* Ifdef:: Testing if a macro is defined
+* Ifelse:: If-else construct, or multibranch
+* Loops:: Loops and recursion in m4
+
+How to debug macros and input
+
+* Dumpdef:: Displaying macro definitions
+* Trace:: Tracing macro calls
+* Debug Levels:: Controlling debugging output
+* Debug Output:: Saving debugging output
+
+Input control
+
+* Dnl:: Deleting whitespace in input
+* Changequote:: Changing the quote characters
+* Changecom:: Changing the comment delimiters
+* Changeword:: Changing the lexical structure of words
+* M4wrap:: Saving input until end of input
+
+File inclusion
+
+* Include:: Including named files
+* Search Path:: Searching for include files
+
+Diverting and undiverting output
+
+* Divert:: Diverting output
+* Undivert:: Undiverting output
+* Divnum:: Diversion numbers
+* Cleardiv:: Discarding diverted text
+
+Macros for text handling
+
+* Len:: Calculating length of strings
+* Index:: Searching for substrings
+* Regexp:: Searching for regular expressions
+* Substr:: Extracting substrings
+* Translit:: Translating characters
+* Patsubst:: Substituting text by regular expression
+* Format:: Formatting strings (printf-like)
+
+Macros for doing arithmetic
+
+* Incr:: Decrement and increment operators
+* Eval:: Evaluating integer expressions
+
+Running UNIX commands
+
+* Syscmd:: Executing simple commands
+* Esyscmd:: Reading the output of commands
+* Sysval:: Exit codes
+* Maketemp:: Making names for temporary files
+
+Miscellaneous builtin macros
+
+* Errprint:: Printing error messages
+* M4exit:: Exiting from m4
+
+Compatibility with other versions of `m4'
+
+* Extensions:: Extensions in GNU m4
+* Incompatibilities:: Facilities in System V m4 not in GNU m4
+* Other Incompat:: Other incompatibilities
+
+
+File: m4.info, Node: Preliminaries, Next: Syntax, Prev: Top, Up: Top
+
+1 Introduction and preliminaries
+********************************
+
+This first chapter explains what is GNU `m4', where `m4' comes from,
+how to read and use this documentation, how to call the `m4' program
+and how to report bugs about it. It concludes by giving tips for
+reading the remainder of the manual.
+
+ The following chapters then detail all the features of the `m4'
+language.
+
+* Menu:
+
+* Intro:: Introduction to `m4'
+* History:: Historical references
+* Invoking m4:: Invoking `m4'
+* Bugs:: Problems and bugs
+* Manual:: Using this manual
+
+
+File: m4.info, Node: Intro, Next: History, Prev: Preliminaries, Up: Preliminaries
+
+1.1 Introduction to `m4'
+========================
+
+`m4' is a macro processor, in the sense that it copies its input to the
+output, expanding macros as it goes. Macros are either builtin or
+user-defined, and can take any number of arguments. Besides just doing
+macro expansion, `m4' has builtin functions for including named files,
+running UNIX commands, doing integer arithmetic, manipulating text in
+various ways, recursion, etc... `m4' can be used either as a front-end
+to a compiler, or as a macro processor in its own right.
+
+ The `m4' macro processor is widely available on all UNIXes.
+Usually, only a small percentage of users are aware of its existence.
+However, those who do often become commited users. The growing
+popularity of GNU Autoconf, which prerequires GNU `m4' for _generating_
+the `configure' scripts, is an incentive for many to install it, while
+these people will not themselves program in `m4'. GNU `m4' is mostly
+compatible with the System V, Release 3 version, except for some minor
+differences. *Note Compatibility::, for more details.
+
+ Some people found `m4' to be fairly addictive. They first use `m4'
+for simple problems, then take bigger and bigger challenges, learning
+how to write complex `m4' sets of macros along the way. Once really
+addicted, users pursue writing of sophisticated `m4' applications even
+to solve simple problems, devoting more time debugging their `m4'
+scripts than doing real work. Beware that `m4' may be dangerous for
+the health of compulsive programmers.
+
+
+File: m4.info, Node: History, Next: Invoking m4, Prev: Intro, Up: Preliminaries
+
+1.2 Historical references
+=========================
+
+The historical notes included here are fairly incomplete, and not
+authoritative at all. Please knowledgeable users help us to more
+properly write this section.
+
+ `GPM' has been an important ancestor of `m4'. See C. Stratchey: "A
+General Purpose Macro generator", Computer Journal 8,3 (1965), pp. 225
+ff. `GPM' is also succintly described into David Gries classic
+"Compiler Construction for Digital Computers".
+
+ While `GPM' was _pure_, `m4' was meant to deal more with the true
+intricacies of real life: macros could be recognized with being
+pre-announced, skipping whitespace or end-of-lines was made easier,
+more constructs were builtin instead of derived, etc.
+
+ Originally, `m4' was the engine for Rational FORTRAN preprocessor,
+that is, the `ratfor' equivalent of `cpp'.
+
+
+File: m4.info, Node: Invoking m4, Next: Bugs, Prev: History, Up: Preliminaries
+
+1.3 Invoking `m4'
+=================
+
+The format of the `m4' command is:
+
+ `m4' [OPTION...] [MACRO-DEFINITIONS...] [INPUT-FILE...]
+
+ All options begin with `-', or if long option names are used, with a
+`--'. A long option name need not be written completely, and
+unambigous prefix is sufficient. `m4' understands the following
+options:
+
+`--version'
+ Print the version number of the program on standard output, then
+ immediately exit `m4' without reading any INPUT-FILES.
+
+`--help'
+ Print an help summary on standard output, then immediately exit
+ `m4' without reading any INPUT-FILES.
+
+`-G'
+`--traditional'
+ Suppress all the extensions made in this implementation, compared
+ to the System V version. *Note Compatibility::, for a list of
+ these.
+
+`-E'
+`--fatal-warnings'
+ Stop execution and exit `m4' once the first warning has been
+ issued, considering all of them to be fatal.
+
+`-dFLAGS'
+`--debug=FLAGS'
+ Set the debug-level according to the flags FLAGS. The debug-level
+ controls the format and amount of information presented by the
+ debugging functions. *Note Debug Levels::, for more details on
+ the format and meaning of FLAGS.
+
+`-lNUM'
+`--arglength=NUM'
+ Restrict the size of the output generated by macro tracing. *Note
+ Debug Levels::, for more details.
+
+`-oFILE'
+`--error-output=FILE'
+ Redirect debug and trace output to the named file. Error messages
+ are still printed on the standard error output. *Note Debug
+ Output::, for more details.
+
+`-IDIR'
+`--include=DIR'
+ Make `m4' search DIR for included files that are not found in the
+ current working directory. *Note Search Path::, for more details.
+
+`-e'
+`--interactive'
+ Makes this invocation of `m4' interactive. This means that all
+ output will be unbuffered, and interrupts will be ignored.
+
+`-s'
+`--synclines'
+ Generate synchronisation lines, for use by the C preprocessor or
+ other similar tools. This is useful, for example, when `m4' is
+ used as a front end to a compiler. Source file name and line
+ number information is conveyed by directives of the form `#line
+ LINENUM "FILENAME"', which are inserted as needed into the middle
+ of the input. Such directives mean that the following line
+ originated or was expanded from the contents of input file
+ FILENAME at line LINENUM. The `"FILENAME"' part is often omitted
+ when the file name did not change from the previous directive.
+
+ Synchronisation directives are always given on complete lines per
+ themselves. When a synchronisation discrepancy occurs in the
+ middle of an output line, the associated synchronisation directive
+ is delayed until the beginning of the next generated line.
+
+`-P'
+`--prefix-builtins'
+ Internally modify _all_ builtin macro names so they all start with
+ the prefix `m4_'. For example, using this option, one should write
+ `m4_define' instead of `define', and `m4___file__' instead of
+ `__file__'.
+
+`-WREGEXP'
+`--word-regexp=REGEXP'
+ Use an alternative syntax for macro names. This experimental
+ option might not be present on all GNU `m4' implementations.
+ (*note Changeword::).
+
+`-HN'
+`--hashsize=N'
+ Make the internal hash table for symbol lookup be N entries big.
+ The number should be prime. The default is 509 entries. It
+ should not be necessary to increase this value, unless you define
+ an excessive number of macros.
+
+`-LN'
+`--nesting-limit=N'
+ Artificially limit the nesting of macro calls to N levels,
+ stopping program execution if this limit is ever exceeded. When
+ not specified, nesting is limited to 250 levels.
+
+ The precise effect of this option might be more correctly
+ associated with textual nesting than dynamic recursion. It has
+ been useful when some complex `m4' input was generated by
+ mechanical means. Most users would never need this option. If
+ shown to be obtrusive, this option (which is still experimental)
+ might well disappear.
+
+ This option does _not_ have the ability to break endless
+ rescanning loops, while these do not necessarily consume much
+ memory or stack space. Through clever usage of rescanning loops,
+ one can request complex, time-consuming computations to `m4' with
+ useful results. Putting limitations in this area would break `m4'
+ power. There are many pathological cases: `define(`a', `a')a' is
+ only the simplest example (but *note Compatibility::). Expecting
+ GNU `m4' to detect these would be a little like expecting a
+ compiler system to detect and diagnose endless loops: it is a
+ quite _hard_ problem in general, if not undecidable!
+
+`-Q'
+`--quiet'
+`--silent'
+ Suppress warnings about missing or superflous arguments in macro
+ calls.
+
+`-B'
+`-S'
+`-T'
+ These options are present for compatibility with System V `m4', but
+ do nothing in this implementation.
+
+`-NN'
+`--diversions=N'
+ These options are present only for compatibility with previous
+ versions of GNU `m4', and were controlling the number of possible
+ diversions which could be used at the same time. They do nothing,
+ because there is no fixed limit anymore.
+
+
+ Macro definitions and deletions can be made on the command line, by
+using the `-D' and `-U' options. They have the following format:
+
+`-DNAME'
+`-DNAME=VALUE'
+`--define=NAME'
+`--define=NAME=VALUE'
+ This enters NAME into the symbol table, before any input files are
+ read. If `=VALUE' is missing, the value is taken to be the empty
+ string. The VALUE can be any string, and the macro can be defined
+ to take arguments, just as if it was defined from within the input.
+
+`-UNAME'
+`--undefine=NAME'
+ This deletes any predefined meaning NAME might have. Obviously,
+ only predefined macros can be deleted in this way.
+
+`-tNAME'
+`--trace=NAME'
+ This enters NAME into the symbol table, as undefined but traced.
+ The macro will consequently be traced from the point it is defined.
+
+`-FFILE'
+`--freeze-state FILE'
+ Once execution is finished, write out the frozen state on the
+ specified FILE (*note Frozen files::).
+
+`-RFILE'
+`--reload-state FILE'
+ Before execution starts, recover the internal state from the
+ specified frozen FILE (*note Frozen files::).
+
+
+ The remaining arguments on the command line are taken to be input
+file names. If no names are present, the standard input is read. A
+file name of `-' is taken to mean the standard input.
+
+ The input files are read in the sequence given. The standard input
+can only be read once, so the filename `-' should only appear once on
+the command line.
+
+
+File: m4.info, Node: Bugs, Next: Manual, Prev: Invoking m4, Up: Preliminaries
+
+1.4 Problems and bugs
+=====================
+
+If you have problems with GNU `m4' or think you've found a bug, please
+report it. Before reporting a bug, make sure you've actually found a
+real bug. Carefully reread the documentation and see if it really says
+you can do what you're trying to do. If it's not clear whether you
+should be able to do something or not, report that too; it's a bug in
+the documentation!
+
+ Before reporting a bug or trying to fix it yourself, try to isolate
+it to the smallest possible input file that reproduces the problem.
+Then send us the input file and the exact results `m4' gave you. Also
+say what you expected to occur; this will help us decide whether the
+problem was really in the documentation.
+
+ Once you've got a precise problem, send e-mail to (Internet)
+`bug-gnu-utils@prep.ai.mit.edu' or (UUCP)
+`mit-eddie!prep.ai.mit.edu!bug-gnu-utils'. Please include the version
+number of `m4' you are using. You can get this information with the
+command `m4 --version'.
+
+ Non-bug suggestions are always welcome as well. If you have
+questions about things that are unclear in the documentation or are
+just obscure features, please report them too.
+
+
+File: m4.info, Node: Manual, Prev: Bugs, Up: Preliminaries
+
+1.5 Using this manual
+=====================
+
+This manual contains a number of examples of `m4' input and output, and
+a simple notation is used to distinguish input, output and error
+messages from `m4'. Examples are set out from the normal text, and
+shown in a fixed width font, like this
+
+ This is an example of an example!
+
+ To distinguish input from output, all output from `m4' is prefixed
+by the string `=>', and all error messages by the string `error-->'.
+Thus
+
+ Example of input line
+ =>Output line from m4
+ error-->and an error message
+
+ As each of the predefined macros in `m4' is described, a prototype
+call of the macro will be shown, giving descriptive names to the
+arguments, e.g.,
+
+ regexp(STRING, REGEXP, opt REPLACEMENT)
+
+ All macro arguments in `m4' are strings, but some are given special
+interpretation, e.g., as numbers, filenames, regular expressions, etc.
+
+ The `opt' before the third argument shows that this argument is
+optional--if it is left out, it is taken to be the empty string. An
+ellipsis (`...') last in the argument list indicates that any number of
+arguments may follow.
+
+ This document consistently writes and uses "builtin", without an
+hyphen, as if it were an English word. This is how the `builtin'
+primitive is spelled within `m4'.
+
+
+File: m4.info, Node: Syntax, Next: Macros, Prev: Preliminaries, Up: Top
+
+2 Lexical and syntactic conventions
+***********************************
+
+As `m4' reads its input, it separates it into "tokens". A token is
+either a name, a quoted string, or any single character, that is not a
+part of either a name or a string. Input to `m4' can also contain
+comments.
+
+* Menu:
+
+* Names:: Macro names
+* Quoted strings:: Quoting input to m4
+* Other tokens:: Other kinds of input tokens
+* Comments:: Comments in m4 input
+
+
+File: m4.info, Node: Names, Next: Quoted strings, Prev: Syntax, Up: Syntax
+
+2.1 Names
+=========
+
+A name is any sequence of letters, digits, and the character `_'
+(underscore), where the first character is not a digit. If a name has
+a macro definition, it will be subject to macro expansion (*note
+Macros::).
+
+ Examples of legal names are: `foo', `_tmp', and `name01'.
+
+
+File: m4.info, Node: Quoted strings, Next: Other tokens, Prev: Names, Up: Syntax
+
+2.2 Quoted strings
+==================
+
+A quoted string is a sequence of characters surrounded by the quotes
+``' and `'', where the number of start and end quotes within the string
+balances. The value of a string token is the text, with one level of
+quotes stripped off. Thus
+
+ `'
+
+ is the empty string, and
+
+ ``quoted''
+
+ is the string
+
+ `quoted'
+
+ The quote characters can be changed at any time, using the builtin
+macro `changequote'. *Note Changequote::, for more information.
+
+
+File: m4.info, Node: Other tokens, Next: Comments, Prev: Quoted strings, Up: Syntax
+
+2.3 Other tokens
+================
+
+Any character, that is neither a part of a name, nor of a quoted string,
+is a token by itself.
+
+
+File: m4.info, Node: Comments, Prev: Other tokens, Up: Syntax
+
+2.4 Comments
+============
+
+Comments in `m4' are normally delimited by the characters `#' and
+newline. All characters between the comment delimiters are ignored,
+but the entire comment (including the delimiters) is passed through to
+the output--comments are _not_ discarded by `m4'.
+
+ Comments cannot be nested, so the first newline after a `#' ends the
+comment. The commenting effect of the begin comment character can be
+inhibited by quoting it.
+
+ The comment delimiters can be changed to any string at any time,
+using the builtin macro `changecom'. *Note Changecom::, for more
+information.
+
+
+File: m4.info, Node: Macros, Next: Definitions, Prev: Syntax, Up: Top
+
+3 How to invoke macros
+**********************
+
+This chapter covers macro invocation, macro arguments and how macro
+expansion is treated.
+
+* Menu:
+
+* Invocation:: Macro invocation
+* Inhibiting Invocation:: Preventing macro invocation
+* Macro Arguments:: Macro arguments
+* Quoting Arguments:: On Quoting Arguments to macros
+* Macro expansion:: Expanding macros
+
+
+File: m4.info, Node: Invocation, Next: Inhibiting Invocation, Prev: Macros, Up: Macros
+
+3.1 Macro invocation
+====================
+
+Macro invocations has one of the forms
+
+ name
+
+which is a macro invocation without any arguments, or
+
+ name(arg1, arg2, ..., argN)
+
+which is a macro invocation with N arguments. Macros can have any
+number of arguments. All arguments are strings, but different macros
+might interpret the arguments in different ways.
+
+ The opening parenthesis _must_ follow the NAME directly, with no
+spaces in between. If it does not, the macro is called with no
+arguments at all.
+
+ For a macro call to have no arguments, the parentheses _must_ be
+left out. The macro call
+
+ name()
+
+is a macro call with one argument, which is the empty string, not a call
+with no arguments.
+
+
+File: m4.info, Node: Inhibiting Invocation, Next: Macro Arguments, Prev: Invocation, Up: Macros
+
+3.2 Preventing macro invocation
+===============================
+
+An innovation of the `m4' language, compared to some of its
+predecessors (like Stratchey's `GPM', for example), is the ability to
+recognize macro calls without resorting to any special, prefixed
+invocation character. While generally useful, this feature might
+sometimes be the source of spurious, unwanted macro calls. So, GNU
+`m4' offers several mechanisms or techniques for inhibiting the
+recognition of names as macro calls.
+
+ First of all, many builtin macros cannot meaningfully be called
+without arguments. For any of these macros, whenever an opening
+parenthesis does not immediately follow their name, the builtin macro
+call is not triggered. This solves the most usual cases, like for
+`include' or `eval'. Later in this document, the sentence "This macro
+is recognized only when given arguments" refers to this specific
+provision.
+
+ There is also a command call option (`--prefix-builtins', or `-P')
+which requires all builtin macro names to be prefixed by `m4_' for them
+to be recognized. The option has no effect whatsoever on user defined
+macros. For example, with this option, one has to write `m4_dnl' and
+even `m4_m4exit'.
+
+ If your version of GNU `m4' has the `changeword' feature compiled
+in, there it offers far more flexibility in specifying the syntax of
+macro names, both builtin or user-defined. *Note Changeword::, for
+more information on this experimental feature.
+
+ Of course, the simplest way to prevent a name to be interpreted as a
+call to an existing macro is to quote it. The remainder of this
+section studies a little more deeply how quoting affects macro
+invocation, and how quoting can be used to inhibit macro invocation.
+
+ Even if quoting is usually done over the whole macro name, it can
+also be done over only a few characters of this name. It is also
+possible to quote the empty string, but this works only _inside_ the
+name. For example:
+
+ `divert'
+ `d'ivert
+ di`ver't
+ div`'ert
+
+all yield the string `divert'. While in both:
+
+ `'divert
+ divert`'
+
+the `divert' builtin macro will be called.
+
+ The output of macro evaluations is always rescanned. The following
+example would yield the string `de', exactly as if `m4' has been given
+`substr(abcde, 3, 2)' as input:
+
+ define(`x', `substr(ab')
+ define(`y', `cde, 3, 2)')
+ x`'y
+
+ Unquoted strings on either side of a quoted string are subject to
+being recognized as macro names. In the following example, quoting the
+empty string allows for the `dnl' macro to be recognized as such:
+
+ define(`macro', `di$1')
+ macro(v)`'dnl
+
+Without the quotes, this would rather yield the string `divdnl'
+followed by an end of line.
+
+ Quoting may prevent recognizing as a macro name the concatenation of
+a macro expansion with the surrounding characters. In this example:
+
+ define(`macro', `di$1')
+ macro(v)`ert'
+
+the input will produce the string `divert'. If the quote was removed,
+the `divert' builtin would be called instead.
+
+
+File: m4.info, Node: Macro Arguments, Next: Quoting Arguments, Prev: Inhibiting Invocation, Up: Macros
+
+3.3 Macro arguments
+===================
+
+When a name is seen, and it has a macro definition, it will be expanded
+as a macro.
+
+ If the name is followed by an opening parenthesis, the arguments
+will be collected before the macro is called. If too few arguments are
+supplied, the missing arguments are taken to be the empty string. If
+there are too many arguments, the excess arguments are ignored.
+
+ Normally `m4' will issue warnings if a builtin macro is called with
+an inappropriate number of arguments, but it can be suppressed with the
+`-Q' command line option. For user defined macros, there is no check
+of the number of arguments given.
+
+ Macros are expanded normally during argument collection, and whatever
+commas, quotes and parentheses that might show up in the resulting
+expanded text will serve to define the arguments as well. Thus, if FOO
+expands to `, b, c', the macro call
+
+ bar(a foo, d)
+
+ is a macro call with four arguments, which are `a ', `b', `c' and
+`d'. To understand why the first argument contains whitespace,
+remember that leading unquoted whitespace is never part of an argument,
+but trailing whitespace always is.
+
+
+File: m4.info, Node: Quoting Arguments, Next: Macro expansion, Prev: Macro Arguments, Up: Macros
+
+3.4 Quoting macro arguments
+===========================
+
+Each argument has leading unquoted whitespace removed. Within each
+argument, all unquoted parentheses must match. For example, if FOO is
+a macro,
+
+ foo(() (`(') `(')
+
+ is a macro call, with one argument, whose value is `() (() ('.
+
+ It is common practice to quote all arguments to macros, unless you
+are sure you want the arguments expanded. Thus, in the above example
+with the parentheses, the `right' way to do it is like this:
+
+ foo(`() (() (')
+
+ It is, however, in certain cases necessary to leave out quotes for
+some arguments, and there is nothing wrong in doing it. It just makes
+life a bit harder, if you are not careful.
+
+
+File: m4.info, Node: Macro expansion, Prev: Quoting Arguments, Up: Macros
+
+3.5 Macro expansion
+===================
+
+When the arguments, if any, to a macro call have been collected, the
+macro is expanded, and the expansion text is pushed back onto the input
+(unquoted), and reread. The expansion text from one macro call might
+therefore result in more macros being called, if the calls are included,
+completely or partially, in the first macro calls' expansion.
+
+ Taking a very simple example, if FOO expands to `bar', and BAR
+expands to `Hello world', the input
+
+ foo
+
+will expand first to `bar', and when this is reread and expanded, into
+`Hello world'.
+
+
+File: m4.info, Node: Definitions, Next: Conditionals, Prev: Macros, Up: Top
+
+4 How to define new macros
+**************************
+
+Macros can be defined, redefined and deleted in several different ways.
+Also, it is possible to redefine a macro, without losing a previous
+value, which can be brought back at a later time.
+
+* Menu:
+
+* Define:: Defining a new macro
+* Arguments:: Arguments to macros
+* Pseudo Arguments:: Pseudo arguments to macros
+* Undefine:: Deleting a macro
+* Defn:: Renaming macros
+* Pushdef:: Temporarily redefining macros
+
+* Indir:: Indirect call of macros
+* Builtin:: Indirect call of builtins
+
+
+File: m4.info, Node: Define, Next: Arguments, Prev: Definitions, Up: Definitions
+
+4.1 Defining a macro
+====================
+
+The normal way to define or redefine macros is to use the builtin
+`define':
+
+ define(NAME [, EXPANSION])
+
+which defines NAME to expand to EXPANSION. If EXPANSION is not given,
+it is taken to be empty.
+
+ The expansion of `define' is void.
+
+ The following example defines the macro FOO to expand to the text
+`Hello World.'.
+
+ define(`foo', `Hello world.')
+ =>
+ foo
+ =>Hello world.
+
+ The empty line in the output is there because the newline is not a
+part of the macro definition, and it is consequently copied to the
+output. This can be avoided by use of the macro `dnl'. *Note Dnl::,
+for details.
+
+ The macro `define' is recognized only with parameters.
+
+
+File: m4.info, Node: Arguments, Next: Pseudo Arguments, Prev: Define, Up: Definitions
+
+4.2 Arguments to macros
+=======================
+
+Macros can have arguments. The Nth argument is denoted by `$n' in the
+expansion text, and is replaced by the Nth actual argument, when the
+macro is expanded. Here is a example of a macro with two arguments.
+It simply exchanges the order of the two arguments.
+
+ define(`exch', `$2, $1')
+ =>
+ exch(arg1, arg2)
+ =>arg2, arg1
+
+ This can be used, for example, if you like the arguments to `define'
+to be reversed.
+
+ define(`exch', `$2, $1')
+ =>
+ define(exch(``expansion text'', ``macro''))
+ =>
+ macro
+ =>expansion text
+
+ *Note Quoting Arguments::, for an explanation of the double quotes.
+
+ GNU `m4' allows the number following the `$' to consist of one or
+more digits, allowing macros to have any number of arguments. This is
+not so in UNIX implementations of `m4', which only recognize one digit.
+
+ As a special case, the zero'th argument, `$0', is always the name of
+the macro being expanded.
+
+ define(`test', ``Macro name: $0'')
+ =>
+ test
+ =>Macro name: test
+
+ If you want quoted text to appear as part of the expansion text,
+remember that quotes can be nested in quoted strings. Thus, in
+
+ define(`foo', `This is macro `foo'.')
+ =>
+ foo
+ =>This is macro foo.
+
+The `foo' in the expansion text is _not_ expanded, since it is a quoted
+string, and not a name.
+
+
+File: m4.info, Node: Pseudo Arguments, Next: Undefine, Prev: Arguments, Up: Definitions
+
+4.3 Special arguments to macros
+===============================
+
+There is a special notation for the number of actual arguments supplied,
+and for all the actual arguments.
+
+ The number of actual arguments in a macro call is denoted by `$#' in
+the expansion text. Thus, a macro to display the number of arguments
+given can be
+
+ define(`nargs', `$#')
+ =>
+ nargs
+ =>0
+ nargs()
+ =>1
+ nargs(arg1, arg2, arg3)
+ =>3
+
+ The notation `$*' can be used in the expansion text to denote all
+the actual arguments, unquoted, with commas in between. For example
+
+ define(`echo', `$*')
+ =>
+ echo(arg1, arg2, arg3 , arg4)
+ =>arg1,arg2,arg3 ,arg4
+
+ Often each argument should be quoted, and the notation `$@' handles
+that. It is just like `$*', except that it quotes each argument. A
+simple example of that is:
+
+ define(`echo', `$@')
+ =>
+ echo(arg1, arg2, arg3 , arg4)
+ =>arg1,arg2,arg3 ,arg4
+
+ Where did the quotes go? Of course, they were eaten, when the
+expanded text were reread by `m4'. To show the difference, try
+
+ define(`echo1', `$*')
+ =>
+ define(`echo2', `$@')
+ =>
+ define(`foo', `This is macro `foo'.')
+ =>
+ echo1(foo)
+ =>This is macro This is macro foo..
+ echo2(foo)
+ =>This is macro foo.
+
+*Note Trace::, if you do not understand this.
+
+ A `$' sign in the expansion text, that is not followed by anything
+`m4' understands, is simply copied to the macro expansion, as any other
+text is.
+
+ define(`foo', `$$$ hello $$$')
+ =>
+ foo
+ =>$$$ hello $$$
+
+ If you want a macro to expand to something like `$12', put a pair of
+quotes after the `$'. This will prevent `m4' from interpreting the `$'
+sign as a reference to an argument.
+
+
+File: m4.info, Node: Undefine, Next: Defn, Prev: Pseudo Arguments, Up: Definitions
+
+4.4 Deleting a macro
+====================
+
+A macro definition can be removed with `undefine':
+
+ undefine(NAME)
+
+which removes the macro NAME. The macro name must necessarily be
+quoted, since it will be expanded otherwise.
+
+ The expansion of `undefine' is void.
+
+ foo
+ =>foo
+ define(`foo', `expansion text')
+ =>
+ foo
+ =>expansion text
+ undefine(`foo')
+ =>
+ foo
+ =>foo
+
+ It is not an error for NAME to have no macro definition. In that
+case, `undefine' does nothing.
+
+ The macro `undefine' is recognized only with parameters.
+
+
+File: m4.info, Node: Defn, Next: Pushdef, Prev: Undefine, Up: Definitions
+
+4.5 Renaming macros
+===================
+
+It is possible to rename an already defined macro. To do this, you need
+the builtin `defn':
+
+ defn(NAME)
+
+which expands to the _quoted definition_ of NAME. If the argument is
+not a defined macro, the expansion is void.
+
+ If NAME is a user-defined macro, the quoted definition is simply the
+quoted expansion text. If, instead, NAME is a builtin, the expansion
+is a special token, which points to the builtin's internal definition.
+This token is only meaningful as the second argument to `define' (and
+`pushdef'), and is ignored in any other context.
+
+ Its normal use is best understood through an example, which shows
+how to rename `undefine' to `zap':
+
+ define(`zap', defn(`undefine'))
+ =>
+ zap(`undefine')
+ =>
+ undefine(`zap')
+ =>undefine(zap)
+
+ In this way, `defn' can be used to copy macro definitions, and also
+definitions of builtin macros. Even if the original macro is removed,
+the other name can still be used to access the definition.
+
+ The macro `defn' is recognized only with parameters.
+
+
+File: m4.info, Node: Pushdef, Next: Indir, Prev: Defn, Up: Definitions
+
+4.6 Temporarily redefining macros
+=================================
+
+It is possible to redefine a macro temporarily, reverting to the
+previous definition at a later time. This is done with the builtins
+`pushdef' and `popdef':
+
+ pushdef(NAME [, EXPANSION])
+ popdef(NAME)
+
+which are quite analogous to `define' and `undefine'.
+
+ These macros work in a stack-like fashion. A macro is temporarily
+redefined with `pushdef', which replaces an existing definition of
+NAME, while saving the previous definition, before the new one is
+installed. If there is no previous definition, `pushdef' behaves
+exactly like `define'.
+
+ If a macro has several definitions (of which only one is accessible),
+the topmost definition can be removed with `popdef'. If there is no
+previous definition, `popdef' behaves like `undefine'.
+
+ define(`foo', `Expansion one.')
+ =>
+ foo
+ =>Expansion one.
+ pushdef(`foo', `Expansion two.')
+ =>
+ foo
+ =>Expansion two.
+ popdef(`foo')
+ =>
+ foo
+ =>Expansion one.
+ popdef(`foo')
+ =>
+ foo
+ =>foo
+
+ If a macro with several definitions is redefined with `define', the
+topmost definition is _replaced_ with the new definition. If it is
+removed with `undefine', _all_ the definitions are removed, and not
+only the topmost one.
+
+ define(`foo', `Expansion one.')
+ =>
+ foo
+ =>Expansion one.
+ pushdef(`foo', `Expansion two.')
+ =>
+ foo
+ =>Expansion two.
+ define(`foo', `Second expansion two.')
+ =>
+ foo
+ =>Second expansion two.
+ undefine(`foo')
+ =>
+ foo
+ =>foo
+
+ It is possible to temporarily redefine a builtin with `pushdef' and
+`defn'.
+
+ The macros `pushdef' and `popdef' are recognized only with
+parameters.
+
+
+File: m4.info, Node: Indir, Next: Builtin, Prev: Pushdef, Up: Definitions
+
+4.7 Indirect call of macros
+===========================
+
+Any macro can be called indirectly with `indir':
+
+ indir(NAME, ...)
+ which results in a call to the macro NAME, which is passed the rest
+of the arguments. This can be used to call macros with "illegal" names
+(`define' allows such names to be defined):
+
+ define(`$$internal$macro', `Internal macro (name `$0')')
+ =>
+ $$internal$macro
+ =>$$internal$macro
+ indir(`$$internal$macro')
+ =>Internal macro (name $$internal$macro)
+
+ The point is, here, that larger macro packages can have private
+macros defined, that will not be called by accident. They can _only_ be
+called through the builtin `indir'.
+
+
+File: m4.info, Node: Builtin, Prev: Indir, Up: Definitions
+
+4.8 Indirect call of builtins
+=============================
+
+Builtin macros can be called indirectly with `builtin':
+
+ builtin(NAME, ...)
+ which results in a call to the builtin NAME, which is passed the
+rest of the arguments. This can be used, if NAME has been given
+another definition that has covered the original.
+
+ The macro `builtin' is recognized only with parameters.
+
+
+File: m4.info, Node: Conditionals, Next: Debugging, Prev: Definitions, Up: Top
+
+5 Conditionals, loops and recursion
+***********************************
+
+Macros, expanding to plain text, perhaps with arguments, are not quite
+enough. We would like to have macros expand to different things, based
+on decisions taken at run-time. E.g., we need some kind of
+conditionals. Also, we would like to have some kind of loop construct,
+so we could do something a number of times, or while some condition is
+true.
+
+* Menu:
+
+* Ifdef:: Testing if a macro is defined
+* Ifelse:: If-else construct, or multibranch
+* Loops:: Loops and recursion in m4
+
+
+File: m4.info, Node: Ifdef, Next: Ifelse, Prev: Conditionals, Up: Conditionals
+
+5.1 Testing macro definitions
+=============================
+
+There are two different builtin conditionals in `m4'. The first is
+`ifdef':
+
+ ifdef(NAME, STRING-1, opt STRING-2)
+
+which makes it possible to test whether a macro is defined or not. If
+NAME is defined as a macro, `ifdef' expands to STRING-1, otherwise to
+STRING-2. If STRING-2 is omitted, it is taken to be the empty string
+(according to the normal rules).
+
+ ifdef(`foo', ``foo' is defined', ``foo' is not defined')
+ =>foo is not defined
+ define(`foo', `')
+ =>
+ ifdef(`foo', ``foo' is defined', ``foo' is not defined')
+ =>foo is defined
+
+ The macro `ifdef' is recognized only with parameters.
+
+
+File: m4.info, Node: Ifelse, Next: Loops, Prev: Ifdef, Up: Conditionals
+
+5.2 Comparing strings
+=====================
+
+The other conditional, `ifelse', is much more powerful. It can be used
+as a way to introduce a long comment, as an if-else construct, or as a
+multibranch, depending on the number of arguments supplied:
+
+ ifelse(COMMENT)
+ ifelse(STRING-1, STRING-2, EQUAL, opt NOT-EQUAL)
+ ifelse(STRING-1, STRING-2, EQUAL, ...)
+
+Used with only one argument, the `ifelse' simply discards it and
+produces no output. This is a common `m4' idiom for introducing a
+block comment, as an alternative to repeatedly using `dnl'. This
+special usage is recognized by GNU `m4', so that in this case, the
+warning about missing arguments is never triggered.
+
+ If called with three or four arguments, `ifelse' expands into EQUAL,
+if STRING-1 and STRING-2 are equal (character for character), otherwise
+it expands to NOT-EQUAL.
+
+ ifelse(foo, bar, `true')
+ =>
+ ifelse(foo, foo, `true')
+ =>true
+ ifelse(foo, bar, `true', `false')
+ =>false
+ ifelse(foo, foo, `true', `false')
+ =>true
+
+ However, `ifelse' can take more than four arguments. If given more
+than four arguments, `ifelse' works like a `case' or `switch' statement
+in traditional programming languages. If STRING-1 and STRING-2 are
+equal, `ifelse' expands into EQUAL, otherwise the procedure is repeated
+with the first three arguments discarded. This calls for an example:
+
+ ifelse(foo, bar, `third', gnu, gnats, `sixth', `seventh')
+ =>seventh
+
+ Naturally, the normal case will be slightly more advanced than these
+examples. A common use of `ifelse' is in macros implementing loops of
+various kinds.
+
+ The macro `ifelse' is recognized only with parameters.
+
+
+File: m4.info, Node: Loops, Prev: Ifelse, Up: Conditionals
+
+5.3 Loops and recursion
+=======================
+
+There is no direct support for loops in `m4', but macros can be
+recursive. There is no limit on the number of recursion levels, other
+than those enforced by your hardware and operating system.
+
+ Loops can be programmed using recursion and the conditionals
+described previously.
+
+ There is a builtin macro, `shift', which can, among other things, be
+used for iterating through the actual arguments to a macro:
+
+ shift(...)
+
+It takes any number of arguments, and expands to all but the first
+argument, separated by commas, with each argument quoted.
+
+ shift(bar)
+ =>
+ shift(foo, bar, baz)
+ =>bar,baz
+
+ An example of the use of `shift' is this macro, which reverses the
+order of its arguments:
+
+ define(`reverse', `ifelse($#, 0, , $#, 1, ``$1'',
+ `reverse(shift($@)), `$1'')')
+ =>
+ reverse
+ =>
+ reverse(foo)
+ =>foo
+ reverse(foo, bar, gnats, and gnus)
+ =>and gnus, gnats, bar, foo
+
+ While not a very interesting macro, it does show how simple loops
+can be made with `shift', `ifelse' and recursion.
+
+ Here is an example of a loop macro that implements a simple forloop.
+It can, for example, be used for simple counting:
+
+ forloop(`i', 1, 8, `i ')
+ =>1 2 3 4 5 6 7 8
+
+ The arguments are a name for the iteration variable, the starting
+value, the final value, and the text to be expanded for each iteration.
+With this macro, the macro `i' is defined only within the loop. After
+the loop, it retains whatever value it might have had before.
+
+ For-loops can be nested, like
+
+ forloop(`i', 1, 4, `forloop(`j', 1, 8, `(i, j) ')
+ ')
+ =>(1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6) (1, 7) (1, 8)
+ =>(2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6) (2, 7) (2, 8)
+ =>(3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6) (3, 7) (3, 8)
+ =>(4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6) (4, 7) (4, 8)
+ =>
+
+ The implementation of the `forloop' macro is fairly straightforward.
+The `forloop' macro itself is simply a wrapper, which saves the
+previous definition of the first argument, calls the internal macro
+`_forloop', and re-establishes the saved definition of the first
+argument.
+
+ The macro `_forloop' expands the fourth argument once, and tests to
+see if it is finished. If it has not finished, it increments the
+iteration variable (using the predefined macro `incr', *note Incr::),
+and recurses.
+
+ Here is the actual implementation of `forloop':
+
+ define(`forloop',
+ `pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
+ define(`_forloop',
+ `$4`'ifelse($1, `$3', ,
+ `define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
+
+ Notice the careful use of quotes. Only three macro arguments are
+unquoted, each for its own reason. Try to find out _why_ these three
+arguments are left unquoted, and see what happens if they are quoted.
+
+ Now, even though these two macros are useful, they are still not
+robust enough for general use. They lack even basic error handling of
+cases like start value less than final value, and the first argument
+not being a name. Correcting these errors are left as an exercise to
+the reader.
+
+
+File: m4.info, Node: Debugging, Next: Input Control, Prev: Conditionals, Up: Top
+
+6 How to debug macros and input
+*******************************
+
+When writing macros for `m4', most of the time they woould not work as
+intended (as is the case with most programming languages). There is a
+little support for macro debugging in `m4'.
+
+* Menu:
+
+* Dumpdef:: Displaying macro definitions
+* Trace:: Tracing macro calls
+* Debug Levels:: Controlling debugging output
+* Debug Output:: Saving debugging output
+
+
+File: m4.info, Node: Dumpdef, Next: Trace, Prev: Debugging, Up: Debugging
+
+6.1 Displaying macro definitions
+================================
+
+If you want to see what a name expands into, you can use the builtin
+`dumpdef':
+
+ dumpdef(...)
+
+which accepts any number of arguments. If called without any arguments,
+it displays the definitions of all known names, otherwise it displays
+the definitions of the names given. The output is printed directly on
+the standard error output.
+
+ The expansion of `dumpdef' is void.
+
+ define(`foo', `Hello world.')
+ =>
+ dumpdef(`foo')
+ error-->foo: `Hello world.'
+ =>
+ dumpdef(`define')
+ error-->define: <define>
+ =>
+
+ The last example shows how builtin macros definitions are displayed.
+
+ *Note Debug Levels::, for information on controlling the details of
+the display.
+
+
+File: m4.info, Node: Trace, Next: Debug Levels, Prev: Dumpdef, Up: Debugging
+
+6.2 Tracing macro calls
+=======================
+
+It is possible to trace macro calls and expansions through the builtins
+`traceon' and `traceoff':
+
+ traceon(...)
+ traceoff(...)
+
+When called without any arguments, `traceon' and `traceoff' will turn
+tracing on and off, respectively, for all defined macros. When called
+with arguments, only the named macros are affected.
+
+ The expansion of `traceon' and `traceoff' is void.
+
+ Whenever a traced macro is called and the arguments have been
+collected, the call is displayed. If the expansion of the macro call
+is not void, the expansion can be displayed after the call. The output
+is printed directly on the standard error output.
+
+ define(`foo', `Hello World.')
+ =>
+ define(`echo', `$@')
+ =>
+ traceon(`foo', `echo')
+ =>
+ foo
+ error-->m4trace: -1- foo -> `Hello World.'
+ =>Hello World.
+ echo(gnus, and gnats)
+ error-->m4trace: -1- echo(`gnus', `and gnats') -> ``gnus',`and gnats''
+ =>gnus,and gnats
+
+ The number between dashes is the depth of the expansion. It is one
+most of the time, signifying an expansion at the outermost level, but it
+increases when macro arguments contain unquoted macro calls.
+
+ *Note Debug Levels::, for information on controlling the details of
+the display.
+
+
+File: m4.info, Node: Debug Levels, Next: Debug Output, Prev: Trace, Up: Debugging
+
+6.3 Controlling debugging output
+================================
+
+The `-d' option to `m4' controls the amount of details presented, when
+using the macros described in the preceding sections.
+
+ The FLAGS following the option can be one or more of the following:
+
+`t'
+ Trace all macro calls made in this invocation of `m4'.
+
+`a'
+ Show the actual arguments in each macro call. This applies to all
+ macro calls if the `t' flag is used, otherwise only the macros
+ covered by calls of `traceon'.
+
+`e'
+ Show the expansion of each macro call, if it is not void. This
+ applies to all macro calls if the `t' flag is used, otherwise only
+ the macros covered by calls of `traceon'.
+
+`q'
+ Quote actual arguments and macro expansions in the display with the
+ current quotes.
+
+`c'
+ Show several trace lines for each macro call. A line is shown
+ when the macro is seen, but before the arguments are collected; a
+ second line when the arguments have been collected and a third
+ line after the call has completed.
+
+`x'
+ Add a unique `macro call id' to each line of the trace output.
+ This is useful in connection with the `c' flag above.
+
+`f'
+ Show the name of the current input file in each trace output line.
+
+`l'
+ Show the the current input line number in each trace output line.
+
+`p'
+ Print a message when a named file is found through the path search
+ mecanism (*note Search Path::), giving the actual filename used.
+
+`i'
+ Print a message each time the current input file is changed,
+ giving file name and input line number.
+
+`V'
+ A shorthand for all of the above flags.
+
+ If no flags are specified with the `-d' option, the default is
+`aeq'. The examples in the previous two sections assumed the default
+flags.
+
+ There is a builtin macro `debugmode', which allows on-the-fly
+control of the debugging output format:
+
+ debugmode(opt FLAGS)
+ The argument FLAGS should be a subset of the letters listed above.
+As special cases, if the argument starts with a `+', the flags are
+added to the current debug flags, and if it starts with a `-', they are
+removed. If no argument is present, the debugging flags are set to
+zero (as if no `-d' was given), and with an empty argument the flags
+are reset to the default.
+
+
+File: m4.info, Node: Debug Output, Prev: Debug Levels, Up: Debugging
+
+6.4 Saving debugging output
+===========================
+
+Debug and tracing output can be redirected to files using either the
+`-o' option to `m4', or with the builtin macro `debugfile':
+
+ debugfile(opt FILENAME)
+ will send all further debug and trace output to FILENAME. If
+FILENAME is empty, debug and trace output are discarded and if
+`debugfile' is called without any arguments, debug and trace output are
+sent to the standard error output.
+
+
+File: m4.info, Node: Input Control, Next: File Inclusion, Prev: Debugging, Up: Top
+
+7 Input control
+***************
+
+This chapter describes various builtin macros for controlling the input
+to `m4'.
+
+* Menu:
+
+* Dnl:: Deleting whitespace in input
+* Changequote:: Changing the quote characters
+* Changecom:: Changing the comment delimiters
+* Changeword:: Changing the lexical structure of words
+* M4wrap:: Saving input until end of input
+
+
+File: m4.info, Node: Dnl, Next: Changequote, Prev: Input Control, Up: Input Control
+
+7.1 Deleting whitespace in input
+================================
+
+The builtin `dnl' reads and discards all characters, up to and
+including the first newline:
+
+ dnl
+ and it is often used in connection with `define', to remove the
+newline that follow the call to `define'. Thus
+
+ define(`foo', `Macro `foo'.')dnl A very simple macro, indeed.
+ foo
+ =>Macro foo.
+
+ The input up to and including the next newline is discarded, as
+opposed to the way comments are treated (*note Comments::).
+
+ Usually, `dnl' is immediately followed by an end of line or some
+other whitespace. GNU `m4' will produce a warning diagnostic if `dnl'
+is followed by an open parenthesis. In this case, `dnl' will collect
+and process all arguments, looking for a matching close parenthesis.
+All predictable side effects resulting from this collection will take
+place. `dnl' will return no output. The input following the matching
+close parenthesis up to and including the next newline, on whatever
+line containing it, will still be discarded.
+
+
+File: m4.info, Node: Changequote, Next: Changecom, Prev: Dnl, Up: Input Control
+
+7.2 Changing the quote characters
+=================================
+
+The default quote delimiters can be changed with the builtin
+`changequote':
+
+ changequote(opt START, opt END)
+ where START is the new start-quote delimiter and END is the new
+end-quote delimiter. If any of the arguments are missing, the default
+quotes (``' and `'') are used instead of the void arguments.
+
+ The expansion of `changequote' is void.
+
+ changequote([, ])
+ =>
+ define([foo], [Macro [foo].])
+ =>
+ foo
+ =>Macro foo.
+
+ If no single character is appropriate, START and END can be of any
+length.
+
+ changequote([[, ]])
+ =>
+ define([[foo]], [[Macro [[[foo]]].]])
+ =>
+ foo
+ =>Macro [foo].
+
+ Changing the quotes to the empty strings will effectively disable the
+quoting mechanism, leaving no way to quote text.
+
+ define(`foo', `Macro `FOO'.')
+ =>
+ changequote(, )
+ =>
+ foo
+ =>Macro `FOO'.
+ `foo'
+ =>`Macro `FOO'.'
+
+ There is no way in `m4' to quote a string containing an unmatched
+left quote, except using `changequote' to change the current quotes.
+
+ Neither quote string should start with a letter or `_' (underscore),
+as they will be confused with names in the input. Doing so disables
+the quoting mechanism.
+
+
+File: m4.info, Node: Changecom, Next: Changeword, Prev: Changequote, Up: Input Control
+
+7.3 Changing comment delimiters
+===============================
+
+The default comment delimiters can be changed with the builtin macro
+`changecom':
+
+ changecom(opt START, opt END)
+ where START is the new start-comment delimiter and END is the new
+end-comment delimiter. If any of the arguments are void, the default
+comment delimiters (`#' and newline) are used instead of the void
+arguments. The comment delimiters can be of any length.
+
+ The expansion of `changecom' is void.
+
+ define(`comment', `COMMENT')
+ =>
+ # A normal comment
+ =># A normal comment
+ changecom(`/*', `*/')
+ =>
+ # Not a comment anymore
+ =># Not a COMMENT anymore
+ But: /* this is a comment now */ while this is not a comment
+ =>But: /* this is a comment now */ while this is not a COMMENT
+
+ Note how comments are copied to the output, much as if they were
+quoted strings. If you want the text inside a comment expanded, quote
+the start comment delimiter.
+
+ Calling `changecom' without any arguments disables the commenting
+mechanism completely.
+
+ define(`comment', `COMMENT')
+ =>
+ changecom
+ =>
+ # Not a comment anymore
+ =># Not a COMMENT anymore
+
+
+File: m4.info, Node: Changeword, Next: M4wrap, Prev: Changecom, Up: Input Control
+
+7.4 Changing the lexical structure of words
+===========================================
+
+ The macro `changeword' and all associated functionnality is
+ experimental. It is only available if the `--enable-changeword'
+ option was given to `configure', at GNU `m4' installation time.
+ The functionnality might change or even go away in the future.
+ _Do not rely on it_. Please direct your comments about it the
+ same way you would do for bugs.
+
+ A file being processed by `m4' is split into quoted strings, words
+(potential macro names) and simple tokens (any other single character).
+Initially a word is defined by the following regular expression:
+
+ [_a-zA-Z][_a-zA-Z0-9]*
+
+ Using `changeword', you can change this regular expression. Relaxing
+`m4''s lexical rules might be useful (for example) if you wanted to
+apply translations to a file of numbers:
+
+ changeword(`[_a-zA-Z0-9]+')
+ define(1, 0)
+ =>1
+
+ Tightening the lexical rules is less useful, because it will
+generally make some of the builtins unavailable. You could use it to
+prevent accidental call of builtins, for example:
+
+ define(`_indir', defn(`indir'))
+ changeword(`_[_a-zA-Z0-9]*')
+ esyscmd(foo)
+ _indir(`esyscmd', `ls')
+
+ Because `m4' constructs its words a character at a time, there is a
+restriction on the regular expressions that may be passed to
+`changeword'. This is that if your regular expression accepts `foo',
+it must also accept `f' and `fo'.
+
+ `changeword' has another function. If the regular expression
+supplied contains any bracketed subexpressions, then text outside the
+first of these is discarded before symbol lookup. So:
+
+ changecom(`/*', `*/')
+ changeword(`#\([_a-zA-Z0-9]*\)')
+ #esyscmd(ls)
+
+ `m4' now requires a `#' mark at the beginning of every macro
+invocation, so one can use `m4' to preprocess shell scripts without
+getting `shift' commands swallowed, and plain text without losing
+various common words.
+
+ `m4''s macro substitution is based on text, while TeX's is based on
+tokens. `changeword' can throw this difference into relief. For
+example, here is the same idea represented in TeX and `m4'. First, the
+TeX version:
+
+ \def\a{\message{Hello}}
+ \catcode`\@=0
+ \catcode`\\=12
+ =>@a
+ =>@bye
+
+Then, the `m4' version:
+
+ define(a, `errprint(`Hello')')
+ changeword(`@\([_a-zA-Z0-9]*\)')
+ =>@a
+
+ In the TeX example, the first line defines a macro `a' to print the
+message `Hello'. The second line defines <@> to be usable instead of
+<\> as an escape character. The third line defines <\> to be a normal
+printing character, not an escape. The fourth line invokes the macro
+`a'. So, when TeX is run on this file, it displays the message `Hello'.
+
+ When the `m4' example is passed through `m4', it outputs
+`errprint(Hello)'. The reason for this is that TeX does lexical
+analysis of macro definition when the macro is _defined_. `m4' just
+stores the text, postponing the lexical analysis until the macro is
+_used_.
+
+ You should note that using `changeword' will slow `m4' down by a
+factor of about seven.
+
+
+File: m4.info, Node: M4wrap, Prev: Changeword, Up: Input Control
+
+7.5 Saving input
+================
+
+It is possible to `save' some text until the end of the normal input has
+been seen. Text can be saved, to be read again by `m4' when the normal
+input has been exhausted. This feature is normally used to initiate
+cleanup actions before normal exit, e.g., deleting temporary files.
+
+ To save input text, use the builtin `m4wrap':
+
+ m4wrap(STRING, ...)
+ which stores STRING and the rest of the arguments in a safe place,
+to be reread when end of input is reached.
+
+ define(`cleanup', `This is the `cleanup' actions.
+ ')
+ =>
+ m4wrap(`cleanup')
+ =>
+ This is the first and last normal input line.
+ =>This is the first and last normal input line.
+ ^D
+ =>This is the cleanup actions.
+
+ The saved input is only reread when the end of normal input is seen,
+and not if `m4exit' is used to exit `m4'.
+
+ It is safe to call `m4wrap' from saved text, but then the order in
+which the saved text is reread is undefined. If `m4wrap' is not used
+recursively, the saved pieces of text are reread in the opposite order
+in which they were saved (LIFO--last in, first out).
+
+
+File: m4.info, Node: File Inclusion, Next: Diversions, Prev: Input Control, Up: Top
+
+8 File inclusion
+****************
+
+`m4' allows you to include named files at any point in the input.
+
+* Menu:
+
+* Include:: Including named files
+* Search Path:: Searching for include files
+
+
+File: m4.info, Node: Include, Next: Search Path, Prev: File Inclusion, Up: File Inclusion
+
+8.1 Including named files
+=========================
+
+There are two builtin macros in `m4' for including files:
+
+ include(FILENAME)
+ sinclude(FILENAME)
+
+both of which cause the file named FILENAME to be read by `m4'. When
+the end of the file is reached, input is resumed from the previous
+input file.
+
+ The expansion of `include' and `sinclude' is therefore the contents
+of FILENAME.
+
+ It is an error for an `include'd file not to exist. If you do not
+want error messages about non-existent files, `sinclude' can be used to
+include a file, if it exists, expanding to nothing if it does not.
+
+ include(`no-such-file')
+ =>
+ error-->30.include:2: m4: Cannot open no-such-file: No such file or directory
+ sinclude(`no-such-file')
+ =>
+
+ Assume in the following that the file `incl.m4' contains the lines:
+ Include file start
+ foo
+ Include file end
+ Normally file inclusion is used to insert the contents of a file
+into the input stream. The contents of the file will be read by `m4'
+and macro calls in the file will be expanded:
+
+ define(`foo', `FOO')
+ =>
+ include(`incl.m4')
+ =>Include file start
+ =>FOO
+ =>Include file end
+ =>
+
+ The fact that `include' and `sinclude' expand to the contents of the
+file can be used to define macros that operate on entire files. Here
+is an example, which defines `bar' to expand to the contents of
+`incl.m4':
+
+ define(`bar', include(`incl.m4'))
+ =>
+ This is `bar': >>>bar<<<
+ =>This is bar: >>>Include file start
+ =>foo
+ =>Include file end
+ =><<<
+
+ This use of `include' is not trivial, though, as files can contain
+quotes, commas and parentheses, which can interfere with the way the
+`m4' parser works.
+
+ The builtin macros `include' and `sinclude' are recognized only when
+given arguments.
+
+
+File: m4.info, Node: Search Path, Prev: Include, Up: File Inclusion
+
+8.2 Searching for include files
+===============================
+
+GNU `m4' allows included files to be found in other directories than
+the current working directory.
+
+ If a file is not found in the current working directory, and the file
+name is not absolute, the file will be looked for in a specified search
+path. First, the directories specified with the `-I' option will be
+searched, in the order found on the command line. Second, if the
+`M4PATH' environment variable is set, it is expected to contain a
+colon-separated list of directories, which will be searched in order.
+
+ If the automatic search for include-files causes trouble, the `p'
+debug flag (*note Debug Levels::) can help isolate the problem.
+
+
+File: m4.info, Node: Diversions, Next: Text handling, Prev: File Inclusion, Up: Top
+
+9 Diverting and undiverting output
+**********************************
+
+Diversions are a way of temporarily saving output. The output of `m4'
+can at any time be diverted to a temporary file, and be reinserted into
+the output stream, "undiverted", again at a later time.
+
+ Numbered diversions are counted from 0 upwards, diversion number 0
+being the normal output stream. The number of simultaneous diversions
+is limited mainly by the memory used to describe them, because GNU `m4'
+tries to keep diversions in memory. However, there is a limit to the
+overall memory usable by all diversions taken altogether (512K,
+currently). When this maximum is about to be exceeded, a temporary
+file is opened to receive the contents of the biggest diversion still
+in memory, freeing this memory for other diversions. So, it is
+theoretically possible that the number of diversions be limited by the
+number of available file descriptors.
+
+* Menu:
+
+* Divert:: Diverting output
+* Undivert:: Undiverting output
+* Divnum:: Diversion numbers
+* Cleardiv:: Discarding diverted text
+
+
+File: m4.info, Node: Divert, Next: Undivert, Prev: Diversions, Up: Diversions
+
+9.1 Diverting output
+====================
+
+Output is diverted using `divert':
+
+ divert(opt NUMBER)
+
+where NUMBER is the diversion to be used. If NUMBER is left out, it is
+assumed to be zero.
+
+ The expansion of `divert' is void.
+
+ When all the `m4' input will have been processed, all existing
+diversions are automatically undiverted, in numerical order.
+
+ divert(1)
+ This text is diverted.
+ divert
+ =>
+ This text is not diverted.
+ =>This text is not diverted.
+ ^D
+ =>
+ =>This text is diverted.
+
+ Several calls of `divert' with the same argument do not overwrite
+the previous diverted text, but append to it.
+
+ If output is diverted to a non-existent diversion, it is simply
+discarded. This can be used to suppress unwanted output. A common
+example of unwanted output is the trailing newlines after macro
+definitions. Here is how to avoid them.
+
+ divert(-1)
+ define(`foo', `Macro `foo'.')
+ define(`bar', `Macro `bar'.')
+ divert
+ =>
+
+ This is a common programming idiom in `m4'.
+
+
+File: m4.info, Node: Undivert, Next: Divnum, Prev: Divert, Up: Diversions
+
+9.2 Undiverting output
+======================
+
+Diverted text can be undiverted explicitly using the builtin `undivert':
+
+ undivert(opt NUMBER, ...)
+
+which undiverts the diversions given by the arguments, in the order
+given. If no arguments are supplied, all diversions are undiverted, in
+numerical order.
+
+ The expansion of `undivert' is void.
+
+ divert(1)
+ This text is diverted.
+ divert
+ =>
+ This text is not diverted.
+ =>This text is not diverted.
+ undivert(1)
+ =>
+ =>This text is diverted.
+ =>
+
+ Notice the last two blank lines. One of them comes from the newline
+following `undivert', the other from the newline that followed the
+`divert'! A diversion often starts with a blank line like this.
+
+ When diverted text is undiverted, it is _not_ reread by `m4', but
+rather copied directly to the current output, and it is therefore not
+an error to undivert into a diversion.
+
+ When a diversion has been undiverted, the diverted text is discarded,
+and it is not possible to bring back diverted text more than once.
+
+ divert(1)
+ This text is diverted first.
+ divert(0)undivert(1)dnl
+ =>
+ =>This text is diverted first.
+ undivert(1)
+ =>
+ divert(1)
+ This text is also diverted but not appended.
+ divert(0)undivert(1)dnl
+ =>
+ =>This text is also diverted but not appended.
+
+ Attempts to undivert the current diversion are silently ignored.
+
+ GNU `m4' allows named files to be undiverted. Given a non-numeric
+argument, the contents of the file named will be copied, uninterpreted,
+to the current output. This complements the builtin `include' (*note
+Include::). To illustrate the difference, assume the file `foo'
+contains the word `bar':
+
+ define(`bar', `BAR')
+ =>
+ undivert(`foo')
+ =>bar
+ =>
+ include(`foo')
+ =>BAR
+ =>
+
+
+File: m4.info, Node: Divnum, Next: Cleardiv, Prev: Undivert, Up: Diversions
+
+9.3 Diversion numbers
+=====================
+
+The builtin `divnum':
+
+ divnum
+
+expands to the number of the current diversion.
+
+ Initial divnum
+ =>Initial 0
+ divert(1)
+ Diversion one: divnum
+ divert(2)
+ Diversion two: divnum
+ divert
+ =>
+ ^D
+ =>
+ =>Diversion one: 1
+ =>
+ =>Diversion two: 2
+
+ The last call of `divert' without argument is necessary, since the
+undiverted text would otherwise be diverted itself.
+
+
+File: m4.info, Node: Cleardiv, Prev: Divnum, Up: Diversions
+
+9.4 Discarding diverted text
+============================
+
+Often it is not known, when output is diverted, whether the diverted
+text is actually needed. Since all non-empty diversion are brought back
+on the main output stream when the end of input is seen, a method of
+discarding a diversion is needed. If all diversions should be
+discarded, the easiest is to end the input to `m4' with `divert(-1)'
+followed by an explicit `undivert':
+
+ divert(1)
+ Diversion one: divnum
+ divert(2)
+ Diversion two: divnum
+ divert(-1)
+ undivert
+ ^D
+
+No output is produced at all.
+
+ Clearing selected diversions can be done with the following macro:
+
+ define(`cleardivert',
+ `pushdef(`_num', divnum)divert(-1)undivert($@)divert(_num)popdef(`_num')')
+ =>
+
+ It is called just like `undivert', but the effect is to clear the
+diversions, given by the arguments. (This macro has a nasty bug! You
+should try to see if you can find it and correct it.)
+
+
+File: m4.info, Node: Text handling, Next: Arithmetic, Prev: Diversions, Up: Top
+
+10 Macros for text handling
+***************************
+
+There are a number of builtins in `m4' for manipulating text in various
+ways, extracting substrings, searching, substituting, and so on.
+
+* Menu:
+
+* Len:: Calculating length of strings
+* Index:: Searching for substrings
+* Regexp:: Searching for regular expressions
+* Substr:: Extracting substrings
+* Translit:: Translating characters
+* Patsubst:: Substituting text by regular expression
+* Format:: Formatting strings (printf-like)
+
+
+File: m4.info, Node: Len, Next: Index, Prev: Text handling, Up: Text handling
+
+10.1 Calculating length of strings
+==================================
+
+The length of a string can be calculated by `len':
+
+ len(STRING)
+
+which expands to the length of STRING, as a decimal number.
+
+ len()
+ =>0
+ len(`abcdef')
+ =>6
+
+ The builtin macro `len' is recognized only when given arguments.
+
+
+File: m4.info, Node: Index, Next: Regexp, Prev: Len, Up: Text handling
+
+10.2 Searching for substrings
+=============================
+
+Searching for substrings is done with `index':
+
+ index(STRING, SUBSTRING)
+
+which expands to the index of the first occurrence of SUBSTRING in
+STRING. The first character in STRING has index 0. If SUBSTRING does
+not occur in STRING, `index' expands to `-1'.
+
+ index(`gnus, gnats, and armadillos', `nat')
+ =>7
+ index(`gnus, gnats, and armadillos', `dag')
+ =>-1
+
+ The builtin macro `index' is recognized only when given arguments.
+
+
+File: m4.info, Node: Regexp, Next: Substr, Prev: Index, Up: Text handling
+
+10.3 Searching for regular expressions
+======================================
+
+Searching for regular expressions is done with the builtin `regexp':
+
+ regexp(STRING, REGEXP, opt REPLACEMENT)
+
+which searches for REGEXP in STRING. The syntax for regular
+expressions is the same as in GNU Emacs. *Note Syntax of Regular
+Expressions: (emacs)Regexps.
+
+ If REPLACEMENT is omitted, `regexp' expands to the index of the
+first match of REGEXP in STRING. If REGEXP does not match anywhere in
+STRING, it expands to -1.
+
+ regexp(`GNUs not Unix', `\<[a-z]\w+')
+ =>5
+ regexp(`GNUs not Unix', `\<Q\w*')
+ =>-1
+
+ If REPLACEMENT is supplied, `regexp' changes the expansion to this
+argument, with `\N' substituted by the text matched by the Nth
+parenthesized sub-expression of REGEXP, `\&' being the text the entire
+regular expression matched.
+
+ regexp(`GNUs not Unix', `\w\(\w+\)$', `*** \& *** \1 ***')
+ =>*** Unix *** nix ***
+
+ The builtin macro `regexp' is recognized only when given arguments.
+
+
+File: m4.info, Node: Substr, Next: Translit, Prev: Regexp, Up: Text handling
+
+10.4 Extracting substrings
+==========================
+
+Substrings are extracted with `substr':
+
+ substr(STRING, FROM, opt LENGTH)
+
+which expands to the substring of STRING, which starts at index FROM,
+and extends for LENGTH characters, or to the end of STRING, if LENGTH
+is omitted. The starting index of a string is always 0.
+
+ substr(`gnus, gnats, and armadillos', 6)
+ =>gnats, and armadillos
+ substr(`gnus, gnats, and armadillos', 6, 5)
+ =>gnats
+
+ The builtin macro `substr' is recognized only when given arguments.
+
+
+File: m4.info, Node: Translit, Next: Patsubst, Prev: Substr, Up: Text handling
+
+10.5 Translating characters
+===========================
+
+Character translation is done with `translit':
+
+ translit(STRING, CHARS, REPLACEMENT)
+
+which expands to STRING, with each character that occurs in CHARS
+translated into the character from REPLACEMENT with the same index.
+
+ If REPLACEMENT is shorter than CHARS, the excess characters are
+deleted from the expansion. If REPLACEMENT is omitted, all characters
+in STRING, that are present in CHARS are deleted from the expansion.
+
+ Both CHARS and REPLACEMENT can contain character-ranges, e.g., `a-z'
+(meaning all lowercase letters) or `0-9' (meaning all digits). To
+include a dash `-' in CHARS or REPLACEMENT, place it first or last.
+
+ It is not an error for the last character in the range to be `larger'
+than the first. In that case, the range runs backwards, i.e., `9-0'
+means the string `9876543210'.
+
+ translit(`GNUs not Unix', `A-Z')
+ =>s not nix
+ translit(`GNUs not Unix', `a-z', `A-Z')
+ =>GNUS NOT UNIX
+ translit(`GNUs not Unix', `A-Z', `z-a')
+ =>tmfs not fnix
+
+ The first example deletes all uppercase letters, the second converts
+lowercase to uppercase, and the third `mirrors' all uppercase letters,
+while converting them to lowercase. The two first cases are by far the
+most common.
+
+ The builtin macro `translit' is recognized only when given arguments.
+
+
+File: m4.info, Node: Patsubst, Next: Format, Prev: Translit, Up: Text handling
+
+10.6 Substituting text by regular expression
+============================================
+
+Global substitution in a string is done by `patsubst':
+
+ patsubst(STRING, REGEXP, opt REPLACEMENT)
+ which searches STRING for matches of REGEXP, and substitutes
+REPLACEMENT for each match. The syntax for regular expressions is the
+same as in GNU Emacs.
+
+ The parts of STRING that are not covered by any match of REGEXP are
+copied to the expansion. Whenever a match is found, the search
+proceeds from the end of the match, so a character from STRING will
+never be substituted twice. If REGEXP matches a string of zero length,
+the start position for the search is incremented, to avoid infinite
+loops.
+
+ When a replacement is to be made, REPLACEMENT is inserted into the
+expansion, with `\N' substituted by the text matched by the Nth
+parenthesized sub-expression of REGEXP, `\&' being the text the entire
+regular expression matched.
+
+ The REPLACEMENT argument can be omitted, in which case the text
+matched by REGEXP is deleted.
+
+ patsubst(`GNUs not Unix', `^', `OBS: ')
+ =>OBS: GNUs not Unix
+ patsubst(`GNUs not Unix', `\<', `OBS: ')
+ =>OBS: GNUs OBS: not OBS: Unix
+ patsubst(`GNUs not Unix', `\w*', `(\&)')
+ =>(GNUs)() (not)() (Unix)
+ patsubst(`GNUs not Unix', `\w+', `(\&)')
+ =>(GNUs) (not) (Unix)
+ patsubst(`GNUs not Unix', `[A-Z][a-z]+')
+ =>GN not
+
+ Here is a slightly more realistic example, which capitalizes
+individual word or whole sentences, by substituting calls of the macros
+`upcase' and `downcase' into the strings.
+
+ define(`upcase', `translit(`$*', `a-z', `A-Z')')dnl
+ define(`downcase', `translit(`$*', `A-Z', `a-z')')dnl
+ define(`capitalize1',
+ `regexp(`$1', `^\(\w\)\(\w*\)', `upcase(`\1')`'downcase(`\2')')')dnl
+ define(`capitalize',
+ `patsubst(`$1', `\w+', `capitalize1(`\&')')')dnl
+ capitalize(`GNUs not Unix')
+ =>Gnus Not Unix
+
+ The builtin macro `patsubst' is recognized only when given arguments.
+
+
+File: m4.info, Node: Format, Prev: Patsubst, Up: Text handling
+
+10.7 Formatted output
+=====================
+
+Formatted output can be made with `format':
+
+ format(FORMAT-STRING, ...)
+
+which works much like the C function `printf'. The first argument is a
+format string, which can contain `%' specifications, and the expansion
+of `format' is the formatted string.
+
+ Its use is best described by a few examples:
+
+ define(`foo', `The brown fox jumped over the lazy dog')
+ =>
+ format(`The string "%s" is %d characters long', foo, len(foo))
+ =>The string "The brown fox jumped over the lazy dog" is 38 characters long
+
+ Using the `forloop' macro defined in *Note Loops::, this example
+shows how `format' can be used to produce tabular output.
+
+ forloop(`i', 1, 10, `format(`%6d squared is %10d
+ ', i, eval(i**2))')
+ => 1 squared is 1
+ => 2 squared is 4
+ => 3 squared is 9
+ => 4 squared is 16
+ => 5 squared is 25
+ => 6 squared is 36
+ => 7 squared is 49
+ => 8 squared is 64
+ => 9 squared is 81
+ => 10 squared is 100
+
+ The builtin `format' is modeled after the ANSI C `printf' function,
+and supports the normal `%' specifiers: `c', `s', `d', `o', `x', `X',
+`u', `e', `E' and `f'; it supports field widths and precisions, and the
+modifiers `+', `-', ` ', `0', `#', `h' and `l'. For more details on
+the functioning of `printf', see the C Library Manual.
+
+
+File: m4.info, Node: Arithmetic, Next: UNIX commands, Prev: Text handling, Up: Top
+
+11 Macros for doing arithmetic
+******************************
+
+Integer arithmetic is included in `m4', with a C-like syntax. As
+convenient shorthands, there are builtins for simple increment and
+decrement operations.
+
+* Menu:
+
+* Incr:: Decrement and increment operators
+* Eval:: Evaluating integer expressions
+
+
+File: m4.info, Node: Incr, Next: Eval, Prev: Arithmetic, Up: Arithmetic
+
+11.1 Decrement and increment operators
+======================================
+
+Increment and decrement of integers are supported using the builtins
+`incr' and `decr':
+
+ incr(NUMBER)
+ decr(NUMBER)
+
+which expand to the numerical value of NUMBER, incremented, or
+decremented, respectively, by one.
+
+ incr(4)
+ =>5
+ decr(7)
+ =>6
+
+ The builtin macros `incr' and `decr' are recognized only when given
+arguments.
+
+
+File: m4.info, Node: Eval, Prev: Incr, Up: Arithmetic
+
+11.2 Evaluating integer expressions
+===================================
+
+Integer expressions are evaluated with `eval':
+
+ eval(EXPRESSION, opt RADIX, opt WIDTH)
+
+which expands to the value of EXPRESSION.
+
+ Expressions can contain the following operators, listed in order of
+decreasing precedence.
+
+`-'
+ Unary minus
+
+`**'
+ Exponentiation
+
+`* / %'
+ Multiplication, division and modulo
+
+`+ -'
+ Addition and subtraction
+
+`<< >>'
+ Shift left or right
+
+`== != > >= < <='
+ Relational operators
+
+`!'
+ Logical negation
+
+`~'
+ Bitwise negation
+
+`&'
+ Bitwise and
+
+`^'
+ Bitwise exclusive-or
+
+`|'
+ Bitwise or
+
+`&&'
+ Logical and
+
+`||'
+ Logical or
+
+ All operators, except exponentiation, are left associative.
+
+ Note that many `m4' implementations use `^' as an alternate operator
+for the exponentiation, while many others use `^' for the bitwise
+exclusive-or. GNU `m4' changed its behavior: it used to exponentiate
+for `^', it now computes the bitwise exclusive-or.
+
+ Numbers without special prefix are given decimal. A simple `0'
+prefix introduces an octal number. `0x' introduces an hexadecimal
+number. `0b' introduces a binary number. `0r' introduces a number
+expressed in any radix between 1 and 36: the prefix should be
+immediately followed by the decimal expression of the radix, a colon,
+then the digits making the number. For any radix, the digits are `0',
+`1', `2', .... Beyond `9', the digits are `a', `b' ... up to `z'.
+Lower and upper case letters can be used interchangeably in numbers
+prefixes and as number digits.
+
+ Parentheses may be used to group subexpressions whenever needed.
+For the relational operators, a true relation returns `1', and a false
+relation return `0'.
+
+ Here are a few examples of use of `eval'.
+
+ eval(-3 * 5)
+ =>-15
+ eval(index(`Hello world', `llo') >= 0)
+ =>1
+ define(`square', `eval(($1)**2)')
+ =>
+ square(9)
+ =>81
+ square(square(5)+1)
+ =>676
+ define(`foo', `666')
+ =>
+ eval(`foo'/6)
+ error-->51.eval:14: m4: Bad expression in eval: foo/6
+ =>
+ eval(foo/6)
+ =>111
+
+ As the second to last example shows, `eval' does not handle macro
+names, even if they expand to a valid expression (or part of a valid
+expression). Therefore all macros must be expanded before they are
+passed to `eval'.
+
+ If RADIX is specified, it specifies the radix to be used in the
+expansion. The default radix is 10. The result of `eval' is always
+taken to be signed. The WIDTH argument specifies a minimum output
+width. The result is zero-padded to extend the expansion to the
+requested width.
+
+ eval(666, 10)
+ =>666
+ eval(666, 11)
+ =>556
+ eval(666, 6)
+ =>3030
+ eval(666, 6, 10)
+ =>0000003030
+ eval(-666, 6, 10)
+ =>-000003030
+
+ Take note that RADIX cannot be larger than 36.
+
+ The builtin macro `eval' is recognized only when given arguments.
+
+
+File: m4.info, Node: UNIX commands, Next: Miscellaneous, Prev: Arithmetic, Up: Top
+
+12 Running UNIX commands
+************************
+
+There are a few builtin macros in `m4' that allow you to run UNIX
+commands from within `m4'.
+
+* Menu:
+
+* Syscmd:: Executing simple commands
+* Esyscmd:: Reading the output of commands
+* Sysval:: Exit codes
+* Maketemp:: Making names for temporary files
+
+
+File: m4.info, Node: Syscmd, Next: Esyscmd, Prev: UNIX commands, Up: UNIX commands
+
+12.1 Executing simple commands
+==============================
+
+Any shell command can be executed, using `syscmd':
+
+ syscmd(SHELL-COMMAND)
+
+which executes SHELL-COMMAND as a shell command.
+
+ The expansion of `syscmd' is void, _not_ the output from
+SHELL-COMMAND! Output or error messages from SHELL-COMMAND are not
+read by `m4'. *Note Esyscmd::, if you need to process the command
+output.
+
+ Prior to executing the command, `m4' flushes its output buffers.
+The default standard input, output and error of SHELL-COMMAND are the
+same as those of `m4'.
+
+ The builtin macro `syscmd' is recognized only when given arguments.
+
+
+File: m4.info, Node: Esyscmd, Next: Sysval, Prev: Syscmd, Up: UNIX commands
+
+12.2 Reading the output of commands
+===================================
+
+If you want `m4' to read the output of a UNIX command, use `esyscmd':
+
+ esyscmd(SHELL-COMMAND)
+
+which expands to the standard output of the shell command SHELL-COMMAND.
+
+ Prior to executing the command, `m4' flushes its output buffers.
+The default standard input and error output of SHELL-COMMAND are the
+same as those of `m4'. The error output of SHELL-COMMAND is not a part
+of the expansion: it will appear along with the error output of `m4'.
+
+ Assume you are positioned into the `checks' directory of GNU `m4'
+distribution, then:
+
+ define(`vice', `esyscmd(grep Vice ../COPYING)')
+ =>
+ vice
+ => Ty Coon, President of Vice
+ =>
+
+ Note how the expansion of `esyscmd' has a trailing newline.
+
+ The builtin macro `esyscmd' is recognized only when given arguments.
+
+
+File: m4.info, Node: Sysval, Next: Maketemp, Prev: Esyscmd, Up: UNIX commands
+
+12.3 Exit codes
+===============
+
+To see whether a shell command succeeded, use `sysval':
+
+ sysval
+
+which expands to the exit status of the last shell command run with
+`syscmd' or `esyscmd'.
+
+ syscmd(`false')
+ =>
+ ifelse(sysval, 0, zero, non-zero)
+ =>non-zero
+ syscmd(`true')
+ =>
+ sysval
+ =>0
+
+
+File: m4.info, Node: Maketemp, Prev: Sysval, Up: UNIX commands
+
+12.4 Making names for temporary files
+=====================================
+
+Commands specified to `syscmd' or `esyscmd' might need a temporary
+file, for output or for some other purpose. There is a builtin macro,
+`maketemp', for making temporary file names:
+
+ maketemp(TEMPLATE)
+
+which expands to a name of a new, empty file, made from the string
+TEMPLATE, which should end with the string `XXXXXX'. The six `X''s are
+then replaced, usually with something that includes the process id of
+the `m4' process, in order to make the filename unique.
+
+ maketemp(`/tmp/fooXXXXXX')
+ =>/tmp/fooa07346
+
+ The builtin macro `maketemp' is recognized only when given arguments.
+
+
+File: m4.info, Node: Miscellaneous, Next: Frozen files, Prev: UNIX commands, Up: Top
+
+13 Miscellaneous builtin macros
+*******************************
+
+This chapter describes various builtins, that do not really belong in
+any of the previous chapters.
+
+* Menu:
+
+* Errprint:: Printing error messages
+* M4exit:: Exiting from m4
+
+
+File: m4.info, Node: Errprint, Next: M4exit, Prev: Miscellaneous, Up: Miscellaneous
+
+13.1 Printing error messages
+============================
+
+You can print error messages using `errprint':
+
+ errprint(MESSAGE, ...)
+ which simply prints MESSAGE and the rest of the arguments on the
+standard error output.
+
+ The expansion of `errprint' is void.
+
+ errprint(`Illegal arguments to forloop
+ ')
+ error-->Illegal arguments to forloop
+ =>
+
+ A trailing newline is _not_ printed automatically, so it must be
+supplied as part of the argument, as in the example. (BSD flavored
+`m4''s do append a trailing newline on each `errprint' call).
+
+ To make it possible to specify the location of the error, two
+utility builtins exist:
+
+ __file__
+ __line__
+ which expands to the quoted name of the current input file, and the
+current input line number in that file.
+
+ errprint(`m4:'__file__:__line__: `Input error
+ ')
+ error-->m4:56.errprint:2: Input error
+ =>
+
+
+File: m4.info, Node: M4exit, Prev: Errprint, Up: Miscellaneous
+
+13.2 Exiting from `m4'
+======================
+
+If you need to exit from `m4' before the entire input has been read,
+you can use `m4exit':
+
+ m4exit(opt CODE)
+ which causes `m4' to exit, with exit code CODE. If CODE is left
+out, the exit code is zero.
+
+ define(`fatal_error', `errprint(`m4: '__file__: __line__`: fatal error: $*
+ ')m4exit(1)')
+ =>
+ fatal_error(`This is a BAD one, buster')
+ error-->m4: 57.m4exit: 5: fatal error: This is a BAD one, buster
+
+ After this macro call, `m4' will exit with exit code 1. This macro
+is only intended for error exits, since the normal exit procedures are
+not followed, e.g., diverted text is not undiverted, and saved text
+(*note M4wrap::) is not reread.
+
+
+File: m4.info, Node: Frozen files, Next: Compatibility, Prev: Miscellaneous, Up: Top
+
+14 Fast loading of frozen states
+********************************
+
+Some bigger `m4' applications may be built over a common base
+containing hundreds of definitions and other costly initializations.
+Usually, the common base is kept in one or more declarative files,
+which files are listed on each `m4' invocation prior to the user's
+input file, or else, `include''d from this input file.
+
+ Reading the common base of a big application, over and over again,
+may be time consuming. GNU `m4' offers some machinery to speed up the
+start of an application using lengthy common bases. Presume the user
+repeatedly uses:
+
+ m4 base.m4 input.m4
+
+with a varying contents of `input.m4', but a rather fixed contents for
+`base.m4'. Then, the user might rather execute:
+
+ m4 -F base.m4f base.m4
+
+once, and further execute, as often as needed:
+
+ m4 -R base.m4f input.m4
+
+with the varying input. The first call, containing the `-F' option,
+only reads and executes file `base.m4', so defining various application
+macros and computing other initializations. Only once the input file
+`base.m4' has been completely processed, GNU `m4' produces on
+`base.m4f' a "frozen" file, that is, a file which contains a kind of
+snapshot of the `m4' internal state.
+
+ Later calls, containing the `-R' option, are able to reload the
+internal state of `m4''s memory, from `base.m4f', _prior_ to reading
+any other input files. By this mean, instead of starting with a virgin
+copy of `m4', input will be read after having effectively recovered the
+effect of a prior run. In our example, the effect is the same as if
+file `base.m4' has been read anew. However, this effect is achieved a
+lot faster.
+
+ Only one frozen file may be created or read in any one `m4'
+invocation. It is not possible to recover two frozen files at once.
+However, frozen files may be updated incrementally, through using `-R'
+and `-F' options simultaneously. For example, if some care is taken,
+the command:
+
+ m4 file1.m4 file2.m4 file3.m4 file4.m4
+
+could be broken down in the following sequence, accumulating the same
+output:
+
+ m4 -F file1.m4f file1.m4
+ m4 -R file1.m4f -F file2.m4f file2.m4
+ m4 -R file2.m4f -F file3.m4f file3.m4
+ m4 -R file3.m4f file4.m4
+
+ Some care is necessary because not every effort has been made for
+this to work in all cases. In particular, the trace attribute of
+macros is not handled, nor the current setting of `changeword'. Also,
+interactions for some options of `m4' being used in one call and not
+for the next, have not been fully analyzed yet. On the other end, you
+may be confident that stacks of `pushdef''ed definitions are handled
+correctly, so are `undefine''d or renamed builtins, changed strings for
+quotes or comments.
+
+ When an `m4' run is to be frozen, the automatic undiversion which
+takes place at end of execution is inhibited. Instead, all positively
+numbered diversions are saved into the frozen file. The active
+diversion number is also transmitted.
+
+ A frozen file to be reloaded need not reside in the current
+directory. It is looked up the same way as an `include' file (*note
+Search Path::).
+
+ Frozen files are sharable across architectures. It is safe to write
+a frozen file one one machine and read it on another, given that the
+second machine uses the same, or a newer version of GNU `m4'. These
+are simple (editable) text files, made up of directives, each starting
+with a capital letter and ending with a newline (<NL>). Wherever a
+directive is expected, the character `#' introduces a comment line,
+empty lines are also ignored. In the following descriptions, LENGTHs
+always refer to corresponding STRINGs. Numbers are always expressed in
+decimal. The directives are:
+
+`V NUMBER <NL>'
+ Confirms the format of the file. NUMBER should be 1.
+
+`C LENGTH1 , LENGTH2 <NL> STRING1 STRING2 <NL>'
+ Uses STRING1 and STRING2 as the beginning comment and end comment
+ strings.
+
+`Q LENGTH1 , LENGTH2 <NL> STRING1 STRING2 <NL>'
+ Uses STRING1 and STRING2 as the beginning quote and end quote
+ strings.
+
+`F LENGTH1 , LENGTH2 <NL> STRING1 STRING2 <NL>'
+ Defines, through `pushdef', a definition for STRING1 expanding to
+ the function whose builtin name is STRING2.
+
+`T LENGTH1 , LENGTH2 <NL> STRING1 STRING2 <NL>'
+ Defines, though `pushdef', a definition for STRING1 expanding to
+ the text given by STRING2.
+
+`D NUMBER, LENGTH <NL> STRING <NL>'
+ Selects diversion NUMBER, making it current, then copy STRING in
+ the current diversion. NUMBER may be a negative number for a
+ non-existing diversion. To merely specify an active selection,
+ use this command with an empty STRING. With 0 as the diversion
+ NUMBER, STRING will be issued on standard output at reload time,
+ however this may not be produced from within `m4'.
+
+
+
+File: m4.info, Node: Compatibility, Next: Concept index, Prev: Frozen files, Up: Top
+
+15 Compatibility with other versions of `m4'
+********************************************
+
+This chapter describes the differences between this implementation of
+`m4', and the implementation found under UNIX, notably System V,
+Release 3.
+
+ There are also differences in BSD flavors of `m4'. No attempt is
+made to summarize these here.
+
+* Menu:
+
+* Extensions:: Extensions in GNU m4
+* Incompatibilities:: Facilities in System V m4 not in GNU m4
+* Other Incompat:: Other incompatibilities
+
+
+File: m4.info, Node: Extensions, Next: Incompatibilities, Prev: Compatibility, Up: Compatibility
+
+15.1 Extensions in GNU `m4'
+===========================
+
+This version of `m4' contains a few facilities, that do not exist in
+System V `m4'. These extra facilities are all suppressed by using the
+`-G' command line option, unless overridden by other command line
+options.
+
+ * In the `$'N notation for macro arguments, N can contain several
+ digits, while the System V `m4' only accepts one digit. This
+ allows macros in GNU `m4' to take any number of arguments, and not
+ only nine (*note Arguments::).
+
+ * Files included with `include' and `sinclude' are sought in a user
+ specified search path, if they are not found in the working
+ directory. The search path is specified by the `-I' option and the
+ `M4PATH' environment variable (*note Search Path::).
+
+ * Arguments to `undivert' can be non-numeric, in which case the named
+ file will be included uninterpreted in the output (*note
+ Undivert::).
+
+ * Formatted output is supported through the `format' builtin, which
+ is modeled after the C library function `printf' (*note Format::).
+
+ * Searches and text substitution through regular expressions are
+ supported by the `regexp' (*note Regexp::) and `patsubst' (*note
+ Patsubst::) builtins.
+
+ * The output of shell commands can be read into `m4' with `esyscmd'
+ (*note Esyscmd::).
+
+ * There is indirect access to any builtin macro with `builtin'
+ (*note Builtin::).
+
+ * Macros can be called indirectly through `indir' (*note Indir::).
+
+ * The name of the current input file and the current input line
+ number are accessible through the builtins `__file__' and
+ `__line__' (*note Errprint::).
+
+ * The format of the output from `dumpdef' and macro tracing can be
+ controlled with `debugmode' (*note Debug Levels::).
+
+ * The destination of trace and debug output can be controlled with
+ `debugfile' (*note Debug Output::).
+
+ In addition to the above extensions, GNU `m4' implements the
+following command line options: `-F', `-G', `-I', `-L', `-R', `-V',
+`-W', `-d', `-l', `-o' and `-t'. *Note Invoking m4::, for a
+description of these options.
+
+ Also, the debugging and tracing facilities in GNU `m4' are much more
+extensive than in most other versions of `m4'.
+
+
+File: m4.info, Node: Incompatibilities, Next: Other Incompat, Prev: Extensions, Up: Compatibility
+
+15.2 Facilities in System V `m4' not in GNU `m4'
+================================================
+
+The version of `m4' from System V contains a few facilities that have
+not been implemented in GNU `m4' yet.
+
+ * System V `m4' supports multiple arguments to `defn'. This is not
+ implemented in GNU `m4'. Its usefulness is unclear to me.
+
+
+File: m4.info, Node: Other Incompat, Prev: Incompatibilities, Up: Compatibility
+
+15.3 Other incompatibilities
+============================
+
+There are a few other incompatibilities between this implementation of
+`m4', and the System V version.
+
+ * GNU `m4' implements sync lines differently from System V `m4',
+ when text is being diverted. GNU `m4' outputs the sync lines when
+ the text is being diverted, and System V `m4' when the diverted
+ text is being brought back.
+
+ The problem is which lines and filenames should be attached to
+ text that is being, or has been, diverted. System V `m4' regards
+ all the diverted text as being generated by the source line
+ containing the `undivert' call, whereas GNU `m4' regards the
+ diverted text as being generated at the time it is diverted.
+
+ I expect the sync line option to be used mostly when using `m4' as
+ a front end to a compiler. If a diverted line causes a compiler
+ error, the error messages should most probably refer to the place
+ where the diversion were made, and not where it was inserted again.
+
+ * GNU `m4' makes no attempt at prohiting autoreferential definitions
+ like:
+
+ define(`x', `x')
+ define(`x', `x ')
+
+ There is nothing inherently wrong with defining `x' to return `x'.
+ The wrong thing is to expand `x' unquoted. In `m4', one might
+ use macros to hold strings, as we do for variables in other
+ programming languages, further checking them with:
+
+ ifelse(defn(`HOLDER'), `VALUE', ...)
+
+ In cases like this one, an interdiction for a macro to hold its own
+ name would be a useless limitation. Of course, this leave more
+ rope for the GNU `m4' user to hang himself! Rescanning hangs may
+ be avoided through careful programming, a little like for endless
+ loops in traditional programming languages.
+
+ * GNU `m4' without `-G' option will define the macro `__gnu__' to
+ expand to the empty string.
+
+ On UNIX systems, GNU `m4' without the `-G' option will define the
+ macro `__unix__', otherwise the macro `unix'. Both will expand to
+ the empty string.
+
+
+File: m4.info, Node: Concept index, Next: Macro index, Prev: Compatibility, Up: Top
+
+Concept index
+*************
+
+
+* Menu:
+
+* Arguments to macros: Arguments. (line 6)
+* arguments to macros: Macro Arguments. (line 6)
+* arguments to macros, special: Pseudo Arguments. (line 6)
+* arguments, quoted macro: Quoting Arguments. (line 6)
+* arithmetic: Arithmetic. (line 6)
+* builtins, indirect call of: Builtin. (line 6)
+* call of builtins, indirect: Builtin. (line 6)
+* call of macros, indirect: Indir. (line 6)
+* changing comment delimiters: Changecom. (line 6)
+* changing the quote delimiters: Changequote. (line 6)
+* characters, translating: Translit. (line 6)
+* command line, filenames on the: Invoking m4. (line 176)
+* command line, macro definitions on the: Invoking m4. (line 143)
+* command line, options: Invoking m4. (line 10)
+* commands, exit code from UNIX: Sysval. (line 6)
+* commands, running UNIX: UNIX commands. (line 6)
+* comment delimiters, changing: Changecom. (line 6)
+* comments: Comments. (line 6)
+* comments, copied to output: Changecom. (line 28)
+* comparing strings: Ifelse. (line 6)
+* compatibility: Compatibility. (line 6)
+* conditionals: Ifdef. (line 6)
+* controlling debugging output: Debug Levels. (line 6)
+* counting loops: Loops. (line 42)
+* debugging output, controlling: Debug Levels. (line 6)
+* debugging output, saving: Debug Output. (line 6)
+* decrement operator: Incr. (line 6)
+* defining new macros: Definitions. (line 6)
+* definitions, displaying macro: Dumpdef. (line 6)
+* deleting macros: Undefine. (line 6)
+* deleting whitespace in input: Dnl. (line 6)
+* discarding diverted text: Cleardiv. (line 6)
+* displaying macro definitions: Dumpdef. (line 6)
+* diversion numbers: Divnum. (line 6)
+* diverted text, discarding: Cleardiv. (line 6)
+* diverting output to files: Divert. (line 6)
+* dumping into frozen file: Frozen files. (line 6)
+* error messages, printing: Errprint. (line 6)
+* evaluation, of integer expressions: Eval. (line 6)
+* executing UNIX commands: UNIX commands. (line 6)
+* exit code from UNIX commands: Sysval. (line 6)
+* exiting from m4: M4exit. (line 6)
+* expansion of macros: Macro expansion. (line 6)
+* expansion, tracing macro: Trace. (line 6)
+* expressions, evaluation of integer: Eval. (line 6)
+* extracting substrings: Substr. (line 6)
+* fast loading of frozen files: Frozen files. (line 6)
+* file inclusion <1>: Undivert. (line 53)
+* file inclusion: File Inclusion. (line 6)
+* filenames, on the command line: Invoking m4. (line 176)
+* files, diverting output to: Divert. (line 6)
+* files, names of temporary: Maketemp. (line 6)
+* forloops: Loops. (line 42)
+* formatted output: Format. (line 6)
+* frozen files for fast loading: Frozen files. (line 6)
+* GNU extensions <1>: Extensions. (line 6)
+* GNU extensions <2>: Frozen files. (line 6)
+* GNU extensions <3>: Esyscmd. (line 6)
+* GNU extensions <4>: Format. (line 6)
+* GNU extensions <5>: Patsubst. (line 6)
+* GNU extensions <6>: Regexp. (line 6)
+* GNU extensions <7>: Undivert. (line 53)
+* GNU extensions <8>: Search Path. (line 6)
+* GNU extensions <9>: Debug Output. (line 6)
+* GNU extensions <10>: Debug Levels. (line 59)
+* GNU extensions <11>: Builtin. (line 6)
+* GNU extensions <12>: Indir. (line 6)
+* GNU extensions: Arguments. (line 28)
+* included files, search path for: Search Path. (line 6)
+* inclusion, of files <1>: Undivert. (line 53)
+* inclusion, of files: File Inclusion. (line 6)
+* increment operator: Incr. (line 6)
+* indirect call of builtins: Builtin. (line 6)
+* indirect call of macros: Indir. (line 6)
+* initialization, frozen states: Frozen files. (line 6)
+* input tokens: Syntax. (line 6)
+* input, saving: M4wrap. (line 6)
+* integer arithmetic: Arithmetic. (line 6)
+* integer expression evaluation: Eval. (line 6)
+* length of strings: Len. (line 6)
+* lexical structure of words: Changeword. (line 6)
+* loops: Loops. (line 10)
+* loops, counting: Loops. (line 42)
+* macro definitions, on the command line: Invoking m4. (line 143)
+* macro expansion, tracing: Trace. (line 6)
+* macro invocation: Invocation. (line 6)
+* macros, arguments to <1>: Arguments. (line 6)
+* macros, arguments to: Macro Arguments. (line 6)
+* macros, displaying definitions: Dumpdef. (line 6)
+* macros, expansion of: Macro expansion. (line 6)
+* macros, how to define new: Definitions. (line 6)
+* macros, how to delete: Undefine. (line 6)
+* macros, how to rename: Defn. (line 6)
+* macros, indirect call of: Indir. (line 6)
+* macros, quoted arguments to: Quoting Arguments. (line 6)
+* macros, recursive: Loops. (line 6)
+* macros, special arguments to: Pseudo Arguments. (line 6)
+* macros, temporary redefinition of: Pushdef. (line 6)
+* messages, printing error: Errprint. (line 6)
+* multibranches: Ifelse. (line 33)
+* names: Names. (line 6)
+* options, command line: Invoking m4. (line 10)
+* output, diverting to files: Divert. (line 6)
+* output, formatted: Format. (line 6)
+* output, saving debugging: Debug Output. (line 6)
+* pattern substitution: Patsubst. (line 6)
+* printing error messages: Errprint. (line 6)
+* quote delimiters, changing the: Changequote. (line 6)
+* quoted macro arguments: Quoting Arguments. (line 6)
+* quoted string: Quoted strings. (line 6)
+* recursive macros: Loops. (line 6)
+* redefinition of macros, temporary: Pushdef. (line 6)
+* regular expressions <1>: Patsubst. (line 6)
+* regular expressions: Regexp. (line 6)
+* reloading a frozen file: Frozen files. (line 6)
+* renaming macros: Defn. (line 6)
+* running UNIX commands: UNIX commands. (line 6)
+* saving debugging output: Debug Output. (line 6)
+* saving input: M4wrap. (line 6)
+* search path for included files: Search Path. (line 6)
+* special arguments to macros: Pseudo Arguments. (line 6)
+* strings, length of: Len. (line 6)
+* substitution by regular expression: Patsubst. (line 6)
+* substrings, extracting: Substr. (line 6)
+* temporary filenames: Maketemp. (line 6)
+* temporary redefinition of macros: Pushdef. (line 6)
+* tokens: Syntax. (line 6)
+* tracing macro expansion: Trace. (line 6)
+* translating characters: Translit. (line 6)
+* undefining macros: Undefine. (line 6)
+* UNIX commands, exit code from: Sysval. (line 6)
+* UNIX commands, running: UNIX commands. (line 6)
+* words, lexical structure of: Changeword. (line 6)
+
+
+File: m4.info, Node: Macro index, Prev: Concept index, Up: Top
+
+Macro index
+***********
+
+References are exclusively to the places where a builtin is introduced
+the first time. Names starting and ending with `__' have these
+characters removed in the index.
+
+
+* Menu:
+
+* builtin: Builtin. (line 6)
+* changecom: Changecom. (line 6)
+* changequote: Changequote. (line 6)
+* changeword: Changeword. (line 6)
+* debugfile: Debug Output. (line 6)
+* debugmode: Debug Levels. (line 59)
+* decr: Incr. (line 6)
+* define: Define. (line 6)
+* defn: Defn. (line 6)
+* divert: Divert. (line 6)
+* divnum: Divnum. (line 6)
+* dnl: Dnl. (line 6)
+* dumpdef: Dumpdef. (line 6)
+* errprint: Errprint. (line 6)
+* esyscmd: Esyscmd. (line 6)
+* eval: Eval. (line 6)
+* file: Errprint. (line 26)
+* format: Format. (line 6)
+* gnu: Other Incompat. (line 44)
+* ifdef: Ifdef. (line 6)
+* ifelse: Ifelse. (line 6)
+* include: Include. (line 6)
+* incr: Incr. (line 6)
+* index: Index. (line 6)
+* indir: Indir. (line 6)
+* len: Len. (line 6)
+* line: Errprint. (line 26)
+* m4exit: M4exit. (line 6)
+* m4wrap: M4wrap. (line 6)
+* maketemp: Maketemp. (line 6)
+* patsubst: Patsubst. (line 6)
+* popdef: Pushdef. (line 7)
+* pushdef: Pushdef. (line 7)
+* regexp: Regexp. (line 6)
+* shift: Loops. (line 13)
+* sinclude: Include. (line 6)
+* substr: Substr. (line 6)
+* syscmd: Syscmd. (line 6)
+* sysval: Sysval. (line 6)
+* traceoff: Trace. (line 6)
+* traceon: Trace. (line 6)
+* translit: Translit. (line 6)
+* undefine: Undefine. (line 6)
+* undivert: Undivert. (line 6)
+* unix: Other Incompat. (line 47)
+
+

Tag Table:
-(Indirect)
-Node: Top959
-Node: Preliminaries6959
-Node: Intro7684
-Node: History9292
-Node: Invoking m410213
-Node: Bugs17007
-Node: Manual18275
-Node: Syntax19641
-Node: Names20228
-Node: Quoted strings20602
-Node: Other tokens21186
-Node: Comments21403
-Node: Macros22065
-Node: Invocation22558
-Node: Inhibiting Invocation23369
-Node: Macro Arguments26514
-Node: Quoting Arguments27778
-Node: Macro expansion28583
-Node: Definitions29246
-Node: Define30023
-Node: Arguments30834
-Node: Pseudo Arguments32315
-Node: Undefine34166
-Node: Defn34828
-Node: Pushdef35985
-Node: Indir37821
-Node: Builtin38583
-Node: Conditionals39027
-Node: Ifdef39734
-Node: Ifelse40503
-Node: Loops42269
-Node: Debugging45542
-Node: Dumpdef46121
-Node: Trace46969
-Node: Debug Levels48348
-Node: Debug Output50733
-Node: Input Control51253
-Node: Dnl51790
-Node: Changequote52916
-Node: Changecom54280
-Node: Changeword55564
-Node: M4wrap58767
-Node: File Inclusion59969
-Node: Include60285
-Node: Search Path62213
-Node: Diversions63000
-Node: Divert64237
-Node: Undivert65369
-Node: Divnum67304
-Node: Cleardiv67849
-Node: Text handling68885
-Node: Len69605
-Node: Index70003
-Node: Regexp70588
-Node: Substr71679
-Node: Translit72299
-Node: Patsubst73742
-Node: Format75833
-Node: Arithmetic77322
-Node: Incr77767
-Node: Eval78271
-Node: UNIX commands81270
-Node: Syscmd81741
-Node: Esyscmd82454
-Node: Sysval83400
-Node: Maketemp83807
-Node: Miscellaneous84864
-Node: Errprint85233
-Node: M4exit86224
-Node: Frozen files87010
-Node: Compatibility91906
-Node: Extensions92524
-Node: Incompatibilities94892
-Node: Other Incompat95334
-Node: Concept index97497
-Node: Macro index104371
+Node: Top947
+Node: Preliminaries6949
+Node: Intro7675
+Node: History9289
+Node: Invoking m410215
+Node: Bugs17016
+Node: Manual18289
+Node: Syntax19660
+Node: Names20248
+Node: Quoted strings20626
+Node: Other tokens21216
+Node: Comments21438
+Node: Macros22106
+Node: Invocation22600
+Node: Inhibiting Invocation23416
+Node: Macro Arguments26567
+Node: Quoting Arguments27836
+Node: Macro expansion28646
+Node: Definitions29314
+Node: Define30091
+Node: Arguments30907
+Node: Pseudo Arguments32392
+Node: Undefine34248
+Node: Defn34915
+Node: Pushdef36077
+Node: Indir37918
+Node: Builtin38687
+Node: Conditionals39138
+Node: Ifdef39846
+Node: Ifelse40620
+Node: Loops42391
+Node: Debugging45668
+Node: Dumpdef46248
+Node: Trace47102
+Node: Debug Levels48487
+Node: Debug Output50877
+Node: Input Control51404
+Node: Dnl51942
+Node: Changequote53074
+Node: Changecom54445
+Node: Changeword55736
+Node: M4wrap58953
+Node: File Inclusion60162
+Node: Include60479
+Node: Search Path62414
+Node: Diversions63205
+Node: Divert64443
+Node: Undivert65580
+Node: Divnum67519
+Node: Cleardiv68069
+Node: Text handling69110
+Node: Len69833
+Node: Index70238
+Node: Regexp70830
+Node: Substr71928
+Node: Translit72555
+Node: Patsubst74005
+Node: Format76105
+Node: Arithmetic77601
+Node: Incr78049
+Node: Eval78560
+Node: UNIX commands81566
+Node: Syscmd82040
+Node: Esyscmd82761
+Node: Sysval83714
+Node: Maketemp84128
+Node: Miscellaneous84878
+Node: Errprint85250
+Node: M4exit86252
+Node: Frozen files87046
+Node: Compatibility91969
+Node: Extensions92590
+Node: Incompatibilities94953
+Node: Other Incompat95402
+Node: Concept index97572
+Node: Macro index107423

End Tag Table
diff --git a/doc/m4.info-1 b/doc/m4.info-1
deleted file mode 100644
index d829eb0a..00000000
--- a/doc/m4.info-1
+++ /dev/null
@@ -1,1495 +0,0 @@
-This is Info file m4.info, produced by Makeinfo-1.55 from the input
-file m4.texinfo.
-
-START-INFO-DIR-ENTRY
-* m4: (m4). A powerful macro processor.
-END-INFO-DIR-ENTRY
-
- This file documents the GNU `m4' utility.
-
- Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994 Free Software
-Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be stated in a
-translation approved by the Foundation.
-
-
-File: m4.info, Node: Top, Next: Preliminaries, Prev: (dir), Up: (dir)
-
-GNU `m4'
-********
-
- GNU `m4' is an implementation of the traditional UNIX macro
-processor. It is mostly SVR4 compatible, although it has some
-extensions (for example, handling more than 9 positional parameters to
-macros). `m4' also has builtin functions for including files, running
-shell commands, doing arithmetic, etc. Autoconf needs GNU `m4' for
-generating `configure' scripts, but not for running them.
-
- GNU `m4' was originally written by Ren'e Seindal, with subsequent
-changes by Franc,ois Pinard and other volunteers on the Internet. All
-names and email addresses can be found in the file `THANKS' from the
-GNU `m4' distribution.
-
- This is release 1.4. It is now to be considered stable, future
-releases are only meant to fix bugs, increase speed, or improve
-documentation. However...
-
- An experimental feature, which would improve `m4' usefulness, allows
-for changing the syntax for what is a "word" in `m4'. You should use:
- ./configure --enable-changeword
-
-if you want this feature compiled in. The current implementation slows
-down `m4' considerably and is hardly acceptable. So, it might go away,
-do not count on it yet.
-
-* Menu:
-
-* Preliminaries:: Introduction and preliminaries
-* Syntax:: Lexical and syntactic conventions
-
-* Macros:: How to invoke macros
-* Definitions:: How to define new macros
-* Conditionals:: Conditionals and loops
-
-* Debugging:: How to debug macros and input
-
-* Input Control:: Input control
-* File Inclusion:: File inclusion
-* Diversions:: Diverting and undiverting output
-
-* Text handling:: Macros for text handling
-* Arithmetic:: Macros for doing arithmetic
-* UNIX commands:: Macros for running UNIX commands
-* Miscellaneous:: Miscellaneous builtin macros
-* Frozen files:: Fast loading of frozen states
-
-* Compatibility:: Compatibility with other versions of m4
-* Concept index:: Index for many concepts
-* Macro index:: Index for all m4 macros
-
- -- The Detailed Node Listing --
-
-Introduction and preliminaries
-
-* Intro:: Introduction to `m4'
-* History:: Historical references
-
-* Invoking m4:: Invoking `m4'
-* Bugs:: Problems and bugs
-* Manual:: Using this manual
-
-Lexical and syntactic conventions
-
-* Names:: Macro names
-* Quoted strings:: Quoting input to m4
-* Other tokens:: Other kinds of input tokens
-* Comments:: Comments in m4 input
-
-How to invoke macros
-
-* Invocation:: Macro invocation
-* Inhibiting Invocation:: Preventing macro invocation
-* Macro Arguments:: Macro arguments
-* Quoting Arguments:: On Quoting Arguments to macros
-* Macro expansion:: Expanding macros
-
-How to define new macros
-
-* Define:: Defining a new macro
-* Arguments:: Arguments to macros
-* Pseudo Arguments:: Pseudo arguments to macros
-* Undefine:: Deleting a macro
-* Defn:: Renaming macros
-* Pushdef:: Temporarily redefining macros
-
-* Indir:: Indirect call of macros
-* Builtin:: Indirect call of builtins
-
-Conditionals, loops and recursion
-
-* Ifdef:: Testing if a macro is defined
-* Ifelse:: If-else construct, or multibranch
-* Loops:: Loops and recursion in m4
-
-How to debug macros and input
-
-* Dumpdef:: Displaying macro definitions
-* Trace:: Tracing macro calls
-* Debug Levels:: Controlling debugging output
-* Debug Output:: Saving debugging output
-
-Input control
-
-* Dnl:: Deleting whitespace in input
-* Changequote:: Changing the quote characters
-* Changecom:: Changing the comment delimiters
-* Changeword:: Changing the lexical structure of words
-* M4wrap:: Saving input until end of input
-
-File inclusion
-
-* Include:: Including named files
-* Search Path:: Searching for include files
-
-Diverting and undiverting output
-
-* Divert:: Diverting output
-* Undivert:: Undiverting output
-* Divnum:: Diversion numbers
-* Cleardiv:: Discarding diverted text
-
-Macros for text handling
-
-* Len:: Calculating length of strings
-* Index:: Searching for substrings
-* Regexp:: Searching for regular expressions
-* Substr:: Extracting substrings
-* Translit:: Translating characters
-* Patsubst:: Substituting text by regular expression
-* Format:: Formatting strings (printf-like)
-
-Macros for doing arithmetic
-
-* Incr:: Decrement and increment operators
-* Eval:: Evaluating integer expressions
-
-Running UNIX commands
-
-* Syscmd:: Executing simple commands
-* Esyscmd:: Reading the output of commands
-* Sysval:: Exit codes
-* Maketemp:: Making names for temporary files
-
-Miscellaneous builtin macros
-
-* Errprint:: Printing error messages
-* M4exit:: Exiting from m4
-
-Compatibility with other versions of `m4'
-
-* Extensions:: Extensions in GNU m4
-* Incompatibilities:: Facilities in System V m4 not in GNU m4
-* Other Incompat:: Other incompatibilities
-
-
-File: m4.info, Node: Preliminaries, Next: Syntax, Prev: Top, Up: Top
-
-Introduction and preliminaries
-******************************
-
- This first chapter explains what is GNU `m4', where `m4' comes from,
-how to read and use this documentation, how to call the `m4' program
-and how to report bugs about it. It concludes by giving tips for
-reading the remainder of the manual.
-
- The following chapters then detail all the features of the `m4'
-language.
-
-* Menu:
-
-* Intro:: Introduction to `m4'
-* History:: Historical references
-* Invoking m4:: Invoking `m4'
-* Bugs:: Problems and bugs
-* Manual:: Using this manual
-
-
-File: m4.info, Node: Intro, Next: History, Prev: Preliminaries, Up: Preliminaries
-
-Introduction to `m4'
-====================
-
- `m4' is a macro processor, in the sense that it copies its input to
-the output, expanding macros as it goes. Macros are either builtin or
-user-defined, and can take any number of arguments. Besides just doing
-macro expansion, `m4' has builtin functions for including named files,
-running UNIX commands, doing integer arithmetic, manipulating text in
-various ways, recursion, etc... `m4' can be used either as a front-end
-to a compiler, or as a macro processor in its own right.
-
- The `m4' macro processor is widely available on all UNIXes.
-Usually, only a small percentage of users are aware of its existence.
-However, those who do often become commited users. The growing
-popularity of GNU Autoconf, which prerequires GNU `m4' for *generating*
-the `configure' scripts, is an incentive for many to install it, while
-these people will not themselves program in `m4'. GNU `m4' is mostly
-compatible with the System V, Release 3 version, except for some minor
-differences. *Note Compatibility:: for more details.
-
- Some people found `m4' to be fairly addictive. They first use `m4'
-for simple problems, then take bigger and bigger challenges, learning
-how to write complex `m4' sets of macros along the way. Once really
-addicted, users pursue writing of sophisticated `m4' applications even
-to solve simple problems, devoting more time debugging their `m4'
-scripts than doing real work. Beware that `m4' may be dangerous for
-the health of compulsive programmers.
-
-
-File: m4.info, Node: History, Next: Invoking m4, Prev: Intro, Up: Preliminaries
-
-Historical references
-=====================
-
- The historical notes included here are fairly incomplete, and not
-authoritative at all. Please knowledgeable users help us to more
-properly write this section.
-
- `GPM' has been an important ancestor of `m4'. See C. Stratchey: "A
-General Purpose Macro generator", Computer Journal 8,3 (1965), pp. 225
-ff. `GPM' is also succintly described into David Gries classic
-"Compiler Construction for Digital Computers".
-
- While `GPM' was *pure*, `m4' was meant to deal more with the true
-intricacies of real life: macros could be recognized with being
-pre-announced, skipping whitespace or end-of-lines was made easier,
-more constructs were builtin instead of derived, etc.
-
- Originally, `m4' was the engine for Rational FORTRAN preprocessor,
-that is, the `ratfor' equivalent of `cpp'.
-
-
-File: m4.info, Node: Invoking m4, Next: Bugs, Prev: History, Up: Preliminaries
-
-Invoking `m4'
-=============
-
- The format of the `m4' command is:
-
- `m4' [OPTION...] [MACRO-DEFINITIONS...] [INPUT-FILE...]
-
- All options begin with `-', or if long option names are used, with a
-`--'. A long option name need not be written completely, and
-unambigous prefix is sufficient. `m4' understands the following
-options:
-
-`--version'
- Print the version number of the program on standard output, then
- immediately exit `m4' without reading any INPUT-FILES.
-
-`--help'
- Print an help summary on standard output, then immediately exit
- `m4' without reading any INPUT-FILES.
-
-`-G'
-`--traditional'
- Suppress all the extensions made in this implementation, compared
- to the System V version. *Note Compatibility::, for a list of
- these.
-
-`-E'
-`--fatal-warnings'
- Stop execution and exit `m4' once the first warning has been
- issued, considering all of them to be fatal.
-
-`-dFLAGS'
-`--debug=FLAGS'
- Set the debug-level according to the flags FLAGS. The debug-level
- controls the format and amount of information presented by the
- debugging functions. *Note Debug Levels:: for more details on the
- format and meaning of FLAGS.
-
-`-lNUM'
-`--arglength=NUM'
- Restrict the size of the output generated by macro tracing. *Note
- Debug Levels:: for more details.
-
-`-oFILE'
-`--error-output=FILE'
- Redirect debug and trace output to the named file. Error messages
- are still printed on the standard error output. *Note Debug
- Output:: for more details.
-
-`-IDIR'
-`--include=DIR'
- Make `m4' search DIR for included files that are not found in the
- current working directory. *Note Search Path:: for more details.
-
-`-e'
-`--interactive'
- Makes this invocation of `m4' interactive. This means that all
- output will be unbuffered, and interrupts will be ignored.
-
-`-s'
-`--synclines'
- Generate synchronisation lines, for use by the C preprocessor or
- other similar tools. This is useful, for example, when `m4' is
- used as a front end to a compiler. Source file name and line
- number information is conveyed by directives of the form `#line
- LINENUM "FILENAME"', which are inserted as needed into the middle
- of the input. Such directives mean that the following line
- originated or was expanded from the contents of input file
- FILENAME at line LINENUM. The `"FILENAME"' part is often omitted
- when the file name did not change from the previous directive.
-
- Synchronisation directives are always given on complete lines per
- themselves. When a synchronisation discrepancy occurs in the
- middle of an output line, the associated synchronisation directive
- is delayed until the beginning of the next generated line.
-
-`-P'
-`--prefix-builtins'
- Internally modify *all* builtin macro names so they all start with
- the prefix `m4_'. For example, using this option, one should write
- `m4_define' instead of `define', and `m4___file__' instead of
- `__file__'.
-
-`-WREGEXP'
-`--word-regexp=REGEXP'
- Use an alternative syntax for macro names. This experimental
- option might not be present on all GNU `m4' implementations.
- (*note Changeword::.).
-
-`-HN'
-`--hashsize=N'
- Make the internal hash table for symbol lookup be N entries big.
- The number should be prime. The default is 509 entries. It
- should not be necessary to increase this value, unless you define
- an excessive number of macros.
-
-`-LN'
-`--nesting-limit=N'
- Artificially limit the nesting of macro calls to N levels,
- stopping program execution if this limit is ever exceeded. When
- not specified, nesting is limited to 250 levels.
-
- The precise effect of this option might be more correctly
- associated with textual nesting than dynamic recursion. It has
- been useful when some complex `m4' input was generated by
- mechanical means. Most users would never need this option. If
- shown to be obtrusive, this option (which is still experimental)
- might well disappear.
-
- This option does *not* have the ability to break endless
- rescanning loops, while these do not necessarily consume much
- memory or stack space. Through clever usage of rescanning loops,
- one can request complex, time-consuming computations to `m4' with
- useful results. Putting limitations in this area would break `m4'
- power. There are many pathological cases: `define(`a', `a')a' is
- only the simplest example (but *note Compatibility::.). Expecting
- GNU `m4' to detect these would be a little like expecting a
- compiler system to detect and diagnose endless loops: it is a
- quite *hard* problem in general, if not undecidable!
-
-`-Q'
-`--quiet'
-`--silent'
- Suppress warnings about missing or superflous arguments in macro
- calls.
-
-`-B'
-`-S'
-`-T'
- These options are present for compatibility with System V `m4', but
- do nothing in this implementation.
-
-`-NN'
-`--diversions=N'
- These options are present only for compatibility with previous
- versions of GNU `m4', and were controlling the number of possible
- diversions which could be used at the same time. They do nothing,
- because there is no fixed limit anymore.
-
- Macro definitions and deletions can be made on the command line, by
-using the `-D' and `-U' options. They have the following format:
-
-`-DNAME'
-`-DNAME=VALUE'
-`--define=NAME'
-`--define=NAME=VALUE'
- This enters NAME into the symbol table, before any input files are
- read. If `=VALUE' is missing, the value is taken to be the empty
- string. The VALUE can be any string, and the macro can be defined
- to take arguments, just as if it was defined from within the input.
-
-`-UNAME'
-`--undefine=NAME'
- This deletes any predefined meaning NAME might have. Obviously,
- only predefined macros can be deleted in this way.
-
-`-tNAME'
-`--trace=NAME'
- This enters NAME into the symbol table, as undefined but traced.
- The macro will consequently be traced from the point it is defined.
-
-`-FFILE'
-`--freeze-state FILE'
- Once execution is finished, write out the frozen state on the
- specified FILE (*note Frozen files::.).
-
-`-RFILE'
-`--reload-state FILE'
- Before execution starts, recover the internal state from the
- specified frozen FILE (*note Frozen files::.).
-
- The remaining arguments on the command line are taken to be input
-file names. If no names are present, the standard input is read. A
-file name of `-' is taken to mean the standard input.
-
- The input files are read in the sequence given. The standard input
-can only be read once, so the filename `-' should only appear once on
-the command line.
-
-
-File: m4.info, Node: Bugs, Next: Manual, Prev: Invoking m4, Up: Preliminaries
-
-Problems and bugs
-=================
-
- If you have problems with GNU `m4' or think you've found a bug,
-please report it. Before reporting a bug, make sure you've actually
-found a real bug. Carefully reread the documentation and see if it
-really says you can do what you're trying to do. If it's not clear
-whether you should be able to do something or not, report that too; it's
-a bug in the documentation!
-
- Before reporting a bug or trying to fix it yourself, try to isolate
-it to the smallest possible input file that reproduces the problem.
-Then send us the input file and the exact results `m4' gave you. Also
-say what you expected to occur; this will help us decide whether the
-problem was really in the documentation.
-
- Once you've got a precise problem, send e-mail to (Internet)
-`bug-gnu-utils@prep.ai.mit.edu' or (UUCP)
-`mit-eddie!prep.ai.mit.edu!bug-gnu-utils'. Please include the version
-number of `m4' you are using. You can get this information with the
-command `m4 --version'.
-
- Non-bug suggestions are always welcome as well. If you have
-questions about things that are unclear in the documentation or are
-just obscure features, please report them too.
-
-
-File: m4.info, Node: Manual, Prev: Bugs, Up: Preliminaries
-
-Using this manual
-=================
-
- This manual contains a number of examples of `m4' input and output,
-and a simple notation is used to distinguish input, output and error
-messages from `m4'. Examples are set out from the normal text, and
-shown in a fixed width font, like this
-
- This is an example of an example!
-
- To distinguish input from output, all output from `m4' is prefixed
-by the string `=>', and all error messages by the string `error-->'.
-Thus
-
- Example of input line
- =>Output line from m4
- error-->and an error message
-
- As each of the predefined macros in `m4' is described, a prototype
-call of the macro will be shown, giving descriptive names to the
-arguments, e.g.,
-
- regexp(STRING, REGEXP, opt REPLACEMENT)
-
- All macro arguments in `m4' are strings, but some are given special
-interpretation, e.g., as numbers, filenames, regular expressions, etc.
-
- The `opt' before the third argument shows that this argument is
-optional--if it is left out, it is taken to be the empty string. An
-ellipsis (`...') last in the argument list indicates that any number of
-arguments may follow.
-
- This document consistently writes and uses "builtin", without an
-hyphen, as if it were an English word. This is how the `builtin'
-primitive is spelled within `m4'.
-
-
-File: m4.info, Node: Syntax, Next: Macros, Prev: Preliminaries, Up: Top
-
-Lexical and syntactic conventions
-*********************************
-
- As `m4' reads its input, it separates it into "tokens". A token is
-either a name, a quoted string, or any single character, that is not a
-part of either a name or a string. Input to `m4' can also contain
-comments.
-
-* Menu:
-
-* Names:: Macro names
-* Quoted strings:: Quoting input to m4
-* Other tokens:: Other kinds of input tokens
-* Comments:: Comments in m4 input
-
-
-File: m4.info, Node: Names, Next: Quoted strings, Prev: Syntax, Up: Syntax
-
-Names
-=====
-
- A name is any sequence of letters, digits, and the character `_'
-(underscore), where the first character is not a digit. If a name has
-a macro definition, it will be subject to macro expansion (*note
-Macros::.).
-
- Examples of legal names are: `foo', `_tmp', and `name01'.
-
-
-File: m4.info, Node: Quoted strings, Next: Other tokens, Prev: Names, Up: Syntax
-
-Quoted strings
-==============
-
- A quoted string is a sequence of characters surrounded by the quotes
-``' and `'', where the number of start and end quotes within the string
-balances. The value of a string token is the text, with one level of
-quotes stripped off. Thus
-
- `'
-
- is the empty string, and
-
- ``quoted''
-
- is the string
-
- `quoted'
-
- The quote characters can be changed at any time, using the builtin
-macro `changequote'. *Note Changequote:: for more information.
-
-
-File: m4.info, Node: Other tokens, Next: Comments, Prev: Quoted strings, Up: Syntax
-
-Other tokens
-============
-
- Any character, that is neither a part of a name, nor of a quoted
-string, is a token by itself.
-
-
-File: m4.info, Node: Comments, Prev: Other tokens, Up: Syntax
-
-Comments
-========
-
- Comments in `m4' are normally delimited by the characters `#' and
-newline. All characters between the comment delimiters are ignored,
-but the entire comment (including the delimiters) is passed through to
-the output--comments are *not* discarded by `m4'.
-
- Comments cannot be nested, so the first newline after a `#' ends the
-comment. The commenting effect of the begin comment character can be
-inhibited by quoting it.
-
- The comment delimiters can be changed to any string at any time,
-using the builtin macro `changecom'. *Note Changecom:: for more
-information.
-
-
-File: m4.info, Node: Macros, Next: Definitions, Prev: Syntax, Up: Top
-
-How to invoke macros
-********************
-
- This chapter covers macro invocation, macro arguments and how macro
-expansion is treated.
-
-* Menu:
-
-* Invocation:: Macro invocation
-* Inhibiting Invocation:: Preventing macro invocation
-* Macro Arguments:: Macro arguments
-* Quoting Arguments:: On Quoting Arguments to macros
-* Macro expansion:: Expanding macros
-
-
-File: m4.info, Node: Invocation, Next: Inhibiting Invocation, Prev: Macros, Up: Macros
-
-Macro invocation
-================
-
- Macro invocations has one of the forms
-
- name
-
-which is a macro invocation without any arguments, or
-
- name(arg1, arg2, ..., argN)
-
-which is a macro invocation with N arguments. Macros can have any
-number of arguments. All arguments are strings, but different macros
-might interpret the arguments in different ways.
-
- The opening parenthesis *must* follow the NAME directly, with no
-spaces in between. If it does not, the macro is called with no
-arguments at all.
-
- For a macro call to have no arguments, the parentheses *must* be
-left out. The macro call
-
- name()
-
-is a macro call with one argument, which is the empty string, not a call
-with no arguments.
-
-
-File: m4.info, Node: Inhibiting Invocation, Next: Macro Arguments, Prev: Invocation, Up: Macros
-
-Preventing macro invocation
-===========================
-
- An innovation of the `m4' language, compared to some of its
-predecessors (like Stratchey's `GPM', for example), is the ability to
-recognize macro calls without resorting to any special, prefixed
-invocation character. While generally useful, this feature might
-sometimes be the source of spurious, unwanted macro calls. So, GNU
-`m4' offers several mechanisms or techniques for inhibiting the
-recognition of names as macro calls.
-
- First of all, many builtin macros cannot meaningfully be called
-without arguments. For any of these macros, whenever an opening
-parenthesis does not immediately follow their name, the builtin macro
-call is not triggered. This solves the most usual cases, like for
-`include' or `eval'. Later in this document, the sentence "This macro
-is recognized only when given arguments" refers to this specific
-provision.
-
- There is also a command call option (`--prefix-builtins', or `-P')
-which requires all builtin macro names to be prefixed by `m4_' for them
-to be recognized. The option has no effect whatsoever on user defined
-macros. For example, with this option, one has to write `m4_dnl' and
-even `m4_m4exit'.
-
- If your version of GNU `m4' has the `changeword' feature compiled
-in, there it offers far more flexibility in specifying the syntax of
-macro names, both builtin or user-defined. *Note Changeword:: for more
-information on this experimental feature.
-
- Of course, the simplest way to prevent a name to be interpreted as a
-call to an existing macro is to quote it. The remainder of this
-section studies a little more deeply how quoting affects macro
-invocation, and how quoting can be used to inhibit macro invocation.
-
- Even if quoting is usually done over the whole macro name, it can
-also be done over only a few characters of this name. It is also
-possible to quote the empty string, but this works only *inside* the
-name. For example:
-
- `divert'
- `d'ivert
- di`ver't
- div`'ert
-
-all yield the string `divert'. While in both:
-
- `'divert
- divert`'
-
-the `divert' builtin macro will be called.
-
- The output of macro evaluations is always rescanned. The following
-example would yield the string `de', exactly as if `m4' has been given
-`substr(abcde, 3, 2)' as input:
-
- define(`x', `substr(ab')
- define(`y', `cde, 3, 2)')
- x`'y
-
- Unquoted strings on either side of a quoted string are subject to
-being recognized as macro names. In the following example, quoting the
-empty string allows for the `dnl' macro to be recognized as such:
-
- define(`macro', `di$1')
- macro(v)`'dnl
-
-Without the quotes, this would rather yield the string `divdnl'
-followed by an end of line.
-
- Quoting may prevent recognizing as a macro name the concatenation of
-a macro expansion with the surrounding characters. In this example:
-
- define(`macro', `di$1')
- macro(v)`ert'
-
-the input will produce the string `divert'. If the quote was removed,
-the `divert' builtin would be called instead.
-
-
-File: m4.info, Node: Macro Arguments, Next: Quoting Arguments, Prev: Inhibiting Invocation, Up: Macros
-
-Macro arguments
-===============
-
- When a name is seen, and it has a macro definition, it will be
-expanded as a macro.
-
- If the name is followed by an opening parenthesis, the arguments
-will be collected before the macro is called. If too few arguments are
-supplied, the missing arguments are taken to be the empty string. If
-there are too many arguments, the excess arguments are ignored.
-
- Normally `m4' will issue warnings if a builtin macro is called with
-an inappropriate number of arguments, but it can be suppressed with the
-`-Q' command line option. For user defined macros, there is no check
-of the number of arguments given.
-
- Macros are expanded normally during argument collection, and whatever
-commas, quotes and parentheses that might show up in the resulting
-expanded text will serve to define the arguments as well. Thus, if FOO
-expands to `, b, c', the macro call
-
- bar(a foo, d)
-
- is a macro call with four arguments, which are `a ', `b', `c' and
-`d'. To understand why the first argument contains whitespace,
-remember that leading unquoted whitespace is never part of an argument,
-but trailing whitespace always is.
-
-
-File: m4.info, Node: Quoting Arguments, Next: Macro expansion, Prev: Macro Arguments, Up: Macros
-
-Quoting macro arguments
-=======================
-
- Each argument has leading unquoted whitespace removed. Within each
-argument, all unquoted parentheses must match. For example, if FOO is
-a macro,
-
- foo(() (`(') `(')
-
- is a macro call, with one argument, whose value is `() (() ('.
-
- It is common practice to quote all arguments to macros, unless you
-are sure you want the arguments expanded. Thus, in the above example
-with the parentheses, the `right' way to do it is like this:
-
- foo(`() (() (')
-
- It is, however, in certain cases necessary to leave out quotes for
-some arguments, and there is nothing wrong in doing it. It just makes
-life a bit harder, if you are not careful.
-
-
-File: m4.info, Node: Macro expansion, Prev: Quoting Arguments, Up: Macros
-
-Macro expansion
-===============
-
- When the arguments, if any, to a macro call have been collected, the
-macro is expanded, and the expansion text is pushed back onto the input
-(unquoted), and reread. The expansion text from one macro call might
-therefore result in more macros being called, if the calls are included,
-completely or partially, in the first macro calls' expansion.
-
- Taking a very simple example, if FOO expands to `bar', and BAR
-expands to `Hello world', the input
-
- foo
-
-will expand first to `bar', and when this is reread and expanded, into
-`Hello world'.
-
-
-File: m4.info, Node: Definitions, Next: Conditionals, Prev: Macros, Up: Top
-
-How to define new macros
-************************
-
- Macros can be defined, redefined and deleted in several different
-ways. Also, it is possible to redefine a macro, without losing a
-previous value, which can be brought back at a later time.
-
-* Menu:
-
-* Define:: Defining a new macro
-* Arguments:: Arguments to macros
-* Pseudo Arguments:: Pseudo arguments to macros
-* Undefine:: Deleting a macro
-* Defn:: Renaming macros
-* Pushdef:: Temporarily redefining macros
-
-* Indir:: Indirect call of macros
-* Builtin:: Indirect call of builtins
-
-
-File: m4.info, Node: Define, Next: Arguments, Prev: Definitions, Up: Definitions
-
-Defining a macro
-================
-
- The normal way to define or redefine macros is to use the builtin
-`define':
-
- define(NAME [, EXPANSION])
-
-which defines NAME to expand to EXPANSION. If EXPANSION is not given,
-it is taken to be empty.
-
- The expansion of `define' is void.
-
- The following example defines the macro FOO to expand to the text
-`Hello World.'.
-
- define(`foo', `Hello world.')
- =>
- foo
- =>Hello world.
-
- The empty line in the output is there because the newline is not a
-part of the macro definition, and it is consequently copied to the
-output. This can be avoided by use of the macro `dnl'. *Note Dnl::,
-for details.
-
- The macro `define' is recognized only with parameters.
-
-
-File: m4.info, Node: Arguments, Next: Pseudo Arguments, Prev: Define, Up: Definitions
-
-Arguments to macros
-===================
-
- Macros can have arguments. The Nth argument is denoted by `$n' in
-the expansion text, and is replaced by the Nth actual argument, when
-the macro is expanded. Here is a example of a macro with two
-arguments. It simply exchanges the order of the two arguments.
-
- define(`exch', `$2, $1')
- =>
- exch(arg1, arg2)
- =>arg2, arg1
-
- This can be used, for example, if you like the arguments to `define'
-to be reversed.
-
- define(`exch', `$2, $1')
- =>
- define(exch(``expansion text'', ``macro''))
- =>
- macro
- =>expansion text
-
- *Note Quoting Arguments::, for an explanation of the double quotes.
-
- GNU `m4' allows the number following the `$' to consist of one or
-more digits, allowing macros to have any number of arguments. This is
-not so in UNIX implementations of `m4', which only recognize one digit.
-
- As a special case, the zero'th argument, `$0', is always the name of
-the macro being expanded.
-
- define(`test', ``Macro name: $0'')
- =>
- test
- =>Macro name: test
-
- If you want quoted text to appear as part of the expansion text,
-remember that quotes can be nested in quoted strings. Thus, in
-
- define(`foo', `This is macro `foo'.')
- =>
- foo
- =>This is macro foo.
-
-The `foo' in the expansion text is *not* expanded, since it is a quoted
-string, and not a name.
-
-
-File: m4.info, Node: Pseudo Arguments, Next: Undefine, Prev: Arguments, Up: Definitions
-
-Special arguments to macros
-===========================
-
- There is a special notation for the number of actual arguments
-supplied, and for all the actual arguments.
-
- The number of actual arguments in a macro call is denoted by `$#' in
-the expansion text. Thus, a macro to display the number of arguments
-given can be
-
- define(`nargs', `$#')
- =>
- nargs
- =>0
- nargs()
- =>1
- nargs(arg1, arg2, arg3)
- =>3
-
- The notation `$*' can be used in the expansion text to denote all
-the actual arguments, unquoted, with commas in between. For example
-
- define(`echo', `$*')
- =>
- echo(arg1, arg2, arg3 , arg4)
- =>arg1,arg2,arg3 ,arg4
-
- Often each argument should be quoted, and the notation `$@' handles
-that. It is just like `$*', except that it quotes each argument. A
-simple example of that is:
-
- define(`echo', `$@')
- =>
- echo(arg1, arg2, arg3 , arg4)
- =>arg1,arg2,arg3 ,arg4
-
- Where did the quotes go? Of course, they were eaten, when the
-expanded text were reread by `m4'. To show the difference, try
-
- define(`echo1', `$*')
- =>
- define(`echo2', `$@')
- =>
- define(`foo', `This is macro `foo'.')
- =>
- echo1(foo)
- =>This is macro This is macro foo..
- echo2(foo)
- =>This is macro foo.
-
-*Note Trace::, if you do not understand this.
-
- A `$' sign in the expansion text, that is not followed by anything
-`m4' understands, is simply copied to the macro expansion, as any other
-text is.
-
- define(`foo', `$$$ hello $$$')
- =>
- foo
- =>$$$ hello $$$
-
- If you want a macro to expand to something like `$12', put a pair of
-quotes after the `$'. This will prevent `m4' from interpreting the `$'
-sign as a reference to an argument.
-
-
-File: m4.info, Node: Undefine, Next: Defn, Prev: Pseudo Arguments, Up: Definitions
-
-Deleting a macro
-================
-
- A macro definition can be removed with `undefine':
-
- undefine(NAME)
-
-which removes the macro NAME. The macro name must necessarily be
-quoted, since it will be expanded otherwise.
-
- The expansion of `undefine' is void.
-
- foo
- =>foo
- define(`foo', `expansion text')
- =>
- foo
- =>expansion text
- undefine(`foo')
- =>
- foo
- =>foo
-
- It is not an error for NAME to have no macro definition. In that
-case, `undefine' does nothing.
-
- The macro `undefine' is recognized only with parameters.
-
-
-File: m4.info, Node: Defn, Next: Pushdef, Prev: Undefine, Up: Definitions
-
-Renaming macros
-===============
-
- It is possible to rename an already defined macro. To do this, you
-need the builtin `defn':
-
- defn(NAME)
-
-which expands to the *quoted definition* of NAME. If the argument is
-not a defined macro, the expansion is void.
-
- If NAME is a user-defined macro, the quoted definition is simply the
-quoted expansion text. If, instead, NAME is a builtin, the expansion
-is a special token, which points to the builtin's internal definition.
-This token is only meaningful as the second argument to `define' (and
-`pushdef'), and is ignored in any other context.
-
- Its normal use is best understood through an example, which shows
-how to rename `undefine' to `zap':
-
- define(`zap', defn(`undefine'))
- =>
- zap(`undefine')
- =>
- undefine(`zap')
- =>undefine(zap)
-
- In this way, `defn' can be used to copy macro definitions, and also
-definitions of builtin macros. Even if the original macro is removed,
-the other name can still be used to access the definition.
-
- The macro `defn' is recognized only with parameters.
-
-
-File: m4.info, Node: Pushdef, Next: Indir, Prev: Defn, Up: Definitions
-
-Temporarily redefining macros
-=============================
-
- It is possible to redefine a macro temporarily, reverting to the
-previous definition at a later time. This is done with the builtins
-`pushdef' and `popdef':
-
- pushdef(NAME [, EXPANSION])
- popdef(NAME)
-
-which are quite analogous to `define' and `undefine'.
-
- These macros work in a stack-like fashion. A macro is temporarily
-redefined with `pushdef', which replaces an existing definition of
-NAME, while saving the previous definition, before the new one is
-installed. If there is no previous definition, `pushdef' behaves
-exactly like `define'.
-
- If a macro has several definitions (of which only one is accessible),
-the topmost definition can be removed with `popdef'. If there is no
-previous definition, `popdef' behaves like `undefine'.
-
- define(`foo', `Expansion one.')
- =>
- foo
- =>Expansion one.
- pushdef(`foo', `Expansion two.')
- =>
- foo
- =>Expansion two.
- popdef(`foo')
- =>
- foo
- =>Expansion one.
- popdef(`foo')
- =>
- foo
- =>foo
-
- If a macro with several definitions is redefined with `define', the
-topmost definition is *replaced* with the new definition. If it is
-removed with `undefine', *all* the definitions are removed, and not
-only the topmost one.
-
- define(`foo', `Expansion one.')
- =>
- foo
- =>Expansion one.
- pushdef(`foo', `Expansion two.')
- =>
- foo
- =>Expansion two.
- define(`foo', `Second expansion two.')
- =>
- foo
- =>Second expansion two.
- undefine(`foo')
- =>
- foo
- =>foo
-
- It is possible to temporarily redefine a builtin with `pushdef' and
-`defn'.
-
- The macros `pushdef' and `popdef' are recognized only with
-parameters.
-
-
-File: m4.info, Node: Indir, Next: Builtin, Prev: Pushdef, Up: Definitions
-
-Indirect call of macros
-=======================
-
- Any macro can be called indirectly with `indir':
-
- indir(NAME, ...)
-
-which results in a call to the macro NAME, which is passed the rest of
-the arguments. This can be used to call macros with "illegal" names
-(`define' allows such names to be defined):
-
- define(`$$internal$macro', `Internal macro (name `$0')')
- =>
- $$internal$macro
- =>$$internal$macro
- indir(`$$internal$macro')
- =>Internal macro (name $$internal$macro)
-
- The point is, here, that larger macro packages can have private
-macros defined, that will not be called by accident. They can *only* be
-called through the builtin `indir'.
-
-
-File: m4.info, Node: Builtin, Prev: Indir, Up: Definitions
-
-Indirect call of builtins
-=========================
-
- Builtin macros can be called indirectly with `builtin':
-
- builtin(NAME, ...)
-
-which results in a call to the builtin NAME, which is passed the rest
-of the arguments. This can be used, if NAME has been given another
-definition that has covered the original.
-
- The macro `builtin' is recognized only with parameters.
-
-
-File: m4.info, Node: Conditionals, Next: Debugging, Prev: Definitions, Up: Top
-
-Conditionals, loops and recursion
-*********************************
-
- Macros, expanding to plain text, perhaps with arguments, are not
-quite enough. We would like to have macros expand to different things,
-based on decisions taken at run-time. E.g., we need some kind of
-conditionals. Also, we would like to have some kind of loop construct,
-so we could do something a number of times, or while some condition is
-true.
-
-* Menu:
-
-* Ifdef:: Testing if a macro is defined
-* Ifelse:: If-else construct, or multibranch
-* Loops:: Loops and recursion in m4
-
-
-File: m4.info, Node: Ifdef, Next: Ifelse, Prev: Conditionals, Up: Conditionals
-
-Testing macro definitions
-=========================
-
- There are two different builtin conditionals in `m4'. The first is
-`ifdef':
-
- ifdef(NAME, STRING-1, opt STRING-2)
-
-which makes it possible to test whether a macro is defined or not. If
-NAME is defined as a macro, `ifdef' expands to STRING-1, otherwise to
-STRING-2. If STRING-2 is omitted, it is taken to be the empty string
-(according to the normal rules).
-
- ifdef(`foo', ``foo' is defined', ``foo' is not defined')
- =>foo is not defined
- define(`foo', `')
- =>
- ifdef(`foo', ``foo' is defined', ``foo' is not defined')
- =>foo is defined
-
- The macro `ifdef' is recognized only with parameters.
-
-
-File: m4.info, Node: Ifelse, Next: Loops, Prev: Ifdef, Up: Conditionals
-
-Comparing strings
-=================
-
- The other conditional, `ifelse', is much more powerful. It can be
-used as a way to introduce a long comment, as an if-else construct, or
-as a multibranch, depending on the number of arguments supplied:
-
- ifelse(COMMENT)
- ifelse(STRING-1, STRING-2, EQUAL, opt NOT-EQUAL)
- ifelse(STRING-1, STRING-2, EQUAL, ...)
-
-Used with only one argument, the `ifelse' simply discards it and
-produces no output. This is a common `m4' idiom for introducing a
-block comment, as an alternative to repeatedly using `dnl'. This
-special usage is recognized by GNU `m4', so that in this case, the
-warning about missing arguments is never triggered.
-
- If called with three or four arguments, `ifelse' expands into EQUAL,
-if STRING-1 and STRING-2 are equal (character for character), otherwise
-it expands to NOT-EQUAL.
-
- ifelse(foo, bar, `true')
- =>
- ifelse(foo, foo, `true')
- =>true
- ifelse(foo, bar, `true', `false')
- =>false
- ifelse(foo, foo, `true', `false')
- =>true
-
- However, `ifelse' can take more than four arguments. If given more
-than four arguments, `ifelse' works like a `case' or `switch' statement
-in traditional programming languages. If STRING-1 and STRING-2 are
-equal, `ifelse' expands into EQUAL, otherwise the procedure is repeated
-with the first three arguments discarded. This calls for an example:
-
- ifelse(foo, bar, `third', gnu, gnats, `sixth', `seventh')
- =>seventh
-
- Naturally, the normal case will be slightly more advanced than these
-examples. A common use of `ifelse' is in macros implementing loops of
-various kinds.
-
- The macro `ifelse' is recognized only with parameters.
-
-
-File: m4.info, Node: Loops, Prev: Ifelse, Up: Conditionals
-
-Loops and recursion
-===================
-
- There is no direct support for loops in `m4', but macros can be
-recursive. There is no limit on the number of recursion levels, other
-than those enforced by your hardware and operating system.
-
- Loops can be programmed using recursion and the conditionals
-described previously.
-
- There is a builtin macro, `shift', which can, among other things, be
-used for iterating through the actual arguments to a macro:
-
- shift(...)
-
-It takes any number of arguments, and expands to all but the first
-argument, separated by commas, with each argument quoted.
-
- shift(bar)
- =>
- shift(foo, bar, baz)
- =>bar,baz
-
- An example of the use of `shift' is this macro, which reverses the
-order of its arguments:
-
- define(`reverse', `ifelse($#, 0, , $#, 1, ``$1'',
- `reverse(shift($@)), `$1'')')
- =>
- reverse
- =>
- reverse(foo)
- =>foo
- reverse(foo, bar, gnats, and gnus)
- =>and gnus, gnats, bar, foo
-
- While not a very interesting macro, it does show how simple loops
-can be made with `shift', `ifelse' and recursion.
-
- Here is an example of a loop macro that implements a simple forloop.
-It can, for example, be used for simple counting:
-
- forloop(`i', 1, 8, `i ')
- =>1 2 3 4 5 6 7 8
-
- The arguments are a name for the iteration variable, the starting
-value, the final value, and the text to be expanded for each iteration.
-With this macro, the macro `i' is defined only within the loop. After
-the loop, it retains whatever value it might have had before.
-
- For-loops can be nested, like
-
- forloop(`i', 1, 4, `forloop(`j', 1, 8, `(i, j) ')
- ')
- =>(1, 1) (1, 2) (1, 3) (1, 4) (1, 5) (1, 6) (1, 7) (1, 8)
- =>(2, 1) (2, 2) (2, 3) (2, 4) (2, 5) (2, 6) (2, 7) (2, 8)
- =>(3, 1) (3, 2) (3, 3) (3, 4) (3, 5) (3, 6) (3, 7) (3, 8)
- =>(4, 1) (4, 2) (4, 3) (4, 4) (4, 5) (4, 6) (4, 7) (4, 8)
- =>
-
- The implementation of the `forloop' macro is fairly straightforward.
-The `forloop' macro itself is simply a wrapper, which saves the
-previous definition of the first argument, calls the internal macro
-`_forloop', and re-establishes the saved definition of the first
-argument.
-
- The macro `_forloop' expands the fourth argument once, and tests to
-see if it is finished. If it has not finished, it increments the
-iteration variable (using the predefined macro `incr', *note Incr::.),
-and recurses.
-
- Here is the actual implementation of `forloop':
-
- define(`forloop',
- `pushdef(`$1', `$2')_forloop(`$1', `$2', `$3', `$4')popdef(`$1')')
- define(`_forloop',
- `$4`'ifelse($1, `$3', ,
- `define(`$1', incr($1))_forloop(`$1', `$2', `$3', `$4')')')
-
- Notice the careful use of quotes. Only three macro arguments are
-unquoted, each for its own reason. Try to find out *why* these three
-arguments are left unquoted, and see what happens if they are quoted.
-
- Now, even though these two macros are useful, they are still not
-robust enough for general use. They lack even basic error handling of
-cases like start value less than final value, and the first argument
-not being a name. Correcting these errors are left as an exercise to
-the reader.
-
-
-File: m4.info, Node: Debugging, Next: Input Control, Prev: Conditionals, Up: Top
-
-How to debug macros and input
-*****************************
-
- When writing macros for `m4', most of the time they woould not work
-as intended (as is the case with most programming languages). There is
-a little support for macro debugging in `m4'.
-
-* Menu:
-
-* Dumpdef:: Displaying macro definitions
-* Trace:: Tracing macro calls
-* Debug Levels:: Controlling debugging output
-* Debug Output:: Saving debugging output
-
-
-File: m4.info, Node: Dumpdef, Next: Trace, Prev: Debugging, Up: Debugging
-
-Displaying macro definitions
-============================
-
- If you want to see what a name expands into, you can use the builtin
-`dumpdef':
-
- dumpdef(...)
-
-which accepts any number of arguments. If called without any arguments,
-it displays the definitions of all known names, otherwise it displays
-the definitions of the names given. The output is printed directly on
-the standard error output.
-
- The expansion of `dumpdef' is void.
-
- define(`foo', `Hello world.')
- =>
- dumpdef(`foo')
- error-->foo: `Hello world.'
- =>
- dumpdef(`define')
- error-->define: <define>
- =>
-
- The last example shows how builtin macros definitions are displayed.
-
- *Note Debug Levels:: for information on controlling the details of
-the display.
-
-
-File: m4.info, Node: Trace, Next: Debug Levels, Prev: Dumpdef, Up: Debugging
-
-Tracing macro calls
-===================
-
- It is possible to trace macro calls and expansions through the
-builtins `traceon' and `traceoff':
-
- traceon(...)
- traceoff(...)
-
-When called without any arguments, `traceon' and `traceoff' will turn
-tracing on and off, respectively, for all defined macros. When called
-with arguments, only the named macros are affected.
-
- The expansion of `traceon' and `traceoff' is void.
-
- Whenever a traced macro is called and the arguments have been
-collected, the call is displayed. If the expansion of the macro call
-is not void, the expansion can be displayed after the call. The output
-is printed directly on the standard error output.
-
- define(`foo', `Hello World.')
- =>
- define(`echo', `$@')
- =>
- traceon(`foo', `echo')
- =>
- foo
- error-->m4trace: -1- foo -> `Hello World.'
- =>Hello World.
- echo(gnus, and gnats)
- error-->m4trace: -1- echo(`gnus', `and gnats') -> ``gnus',`and gnats''
- =>gnus,and gnats
-
- The number between dashes is the depth of the expansion. It is one
-most of the time, signifying an expansion at the outermost level, but it
-increases when macro arguments contain unquoted macro calls.
-
- *Note Debug Levels:: for information on controlling the details of
-the display.
-
-
-File: m4.info, Node: Debug Levels, Next: Debug Output, Prev: Trace, Up: Debugging
-
-Controlling debugging output
-============================
-
- The `-d' option to `m4' controls the amount of details presented,
-when using the macros described in the preceding sections.
-
- The FLAGS following the option can be one or more of the following:
-
-`t'
- Trace all macro calls made in this invocation of `m4'.
-
-`a'
- Show the actual arguments in each macro call. This applies to all
- macro calls if the `t' flag is used, otherwise only the macros
- covered by calls of `traceon'.
-
-`e'
- Show the expansion of each macro call, if it is not void. This
- applies to all macro calls if the `t' flag is used, otherwise only
- the macros covered by calls of `traceon'.
-
-`q'
- Quote actual arguments and macro expansions in the display with the
- current quotes.
-
-`c'
- Show several trace lines for each macro call. A line is shown
- when the macro is seen, but before the arguments are collected; a
- second line when the arguments have been collected and a third
- line after the call has completed.
-
-`x'
- Add a unique `macro call id' to each line of the trace output.
- This is useful in connection with the `c' flag above.
-
-`f'
- Show the name of the current input file in each trace output line.
-
-`l'
- Show the the current input line number in each trace output line.
-
-`p'
- Print a message when a named file is found through the path search
- mecanism (*note Search Path::.), giving the actual filename used.
-
-`i'
- Print a message each time the current input file is changed,
- giving file name and input line number.
-
-`V'
- A shorthand for all of the above flags.
-
- If no flags are specified with the `-d' option, the default is
-`aeq'. The examples in the previous two sections assumed the default
-flags.
-
- There is a builtin macro `debugmode', which allows on-the-fly
-control of the debugging output format:
-
- debugmode(opt FLAGS)
-
-The argument FLAGS should be a subset of the letters listed above. As
-special cases, if the argument starts with a `+', the flags are added
-to the current debug flags, and if it starts with a `-', they are
-removed. If no argument is present, the debugging flags are set to
-zero (as if no `-d' was given), and with an empty argument the flags
-are reset to the default.
-
diff --git a/doc/m4.info-2 b/doc/m4.info-2
deleted file mode 100644
index aedf6a64..00000000
--- a/doc/m4.info-2
+++ /dev/null
@@ -1,1468 +0,0 @@
-This is Info file m4.info, produced by Makeinfo-1.55 from the input
-file m4.texinfo.
-
-START-INFO-DIR-ENTRY
-* m4: (m4). A powerful macro processor.
-END-INFO-DIR-ENTRY
-
- This file documents the GNU `m4' utility.
-
- Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994 Free Software
-Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be stated in a
-translation approved by the Foundation.
-
-
-File: m4.info, Node: Debug Output, Prev: Debug Levels, Up: Debugging
-
-Saving debugging output
-=======================
-
- Debug and tracing output can be redirected to files using either the
-`-o' option to `m4', or with the builtin macro `debugfile':
-
- debugfile(opt FILENAME)
-
-will send all further debug and trace output to FILENAME. If FILENAME
-is empty, debug and trace output are discarded and if `debugfile' is
-called without any arguments, debug and trace output are sent to the
-standard error output.
-
-
-File: m4.info, Node: Input Control, Next: File Inclusion, Prev: Debugging, Up: Top
-
-Input control
-*************
-
- This chapter describes various builtin macros for controlling the
-input to `m4'.
-
-* Menu:
-
-* Dnl:: Deleting whitespace in input
-* Changequote:: Changing the quote characters
-* Changecom:: Changing the comment delimiters
-* Changeword:: Changing the lexical structure of words
-* M4wrap:: Saving input until end of input
-
-
-File: m4.info, Node: Dnl, Next: Changequote, Prev: Input Control, Up: Input Control
-
-Deleting whitespace in input
-============================
-
- The builtin `dnl' reads and discards all characters, up to and
-including the first newline:
-
- dnl
-
-and it is often used in connection with `define', to remove the newline
-that follow the call to `define'. Thus
-
- define(`foo', `Macro `foo'.')dnl A very simple macro, indeed.
- foo
- =>Macro foo.
-
- The input up to and including the next newline is discarded, as
-opposed to the way comments are treated (*note Comments::.).
-
- Usually, `dnl' is immediately followed by an end of line or some
-other whitespace. GNU `m4' will produce a warning diagnostic if `dnl'
-is followed by an open parenthesis. In this case, `dnl' will collect
-and process all arguments, looking for a matching close parenthesis.
-All predictable side effects resulting from this collection will take
-place. `dnl' will return no output. The input following the matching
-close parenthesis up to and including the next newline, on whatever
-line containing it, will still be discarded.
-
-
-File: m4.info, Node: Changequote, Next: Changecom, Prev: Dnl, Up: Input Control
-
-Changing the quote characters
-=============================
-
- The default quote delimiters can be changed with the builtin
-`changequote':
-
- changequote(opt START, opt END)
-
-where START is the new start-quote delimiter and END is the new
-end-quote delimiter. If any of the arguments are missing, the default
-quotes (``' and `'') are used instead of the void arguments.
-
- The expansion of `changequote' is void.
-
- changequote([, ])
- =>
- define([foo], [Macro [foo].])
- =>
- foo
- =>Macro foo.
-
- If no single character is appropriate, START and END can be of any
-length.
-
- changequote([[, ]])
- =>
- define([[foo]], [[Macro [[[foo]]].]])
- =>
- foo
- =>Macro [foo].
-
- Changing the quotes to the empty strings will effectively disable the
-quoting mechanism, leaving no way to quote text.
-
- define(`foo', `Macro `FOO'.')
- =>
- changequote(, )
- =>
- foo
- =>Macro `FOO'.
- `foo'
- =>`Macro `FOO'.'
-
- There is no way in `m4' to quote a string containing an unmatched
-left quote, except using `changequote' to change the current quotes.
-
- Neither quote string should start with a letter or `_' (underscore),
-as they will be confused with names in the input. Doing so disables
-the quoting mechanism.
-
-
-File: m4.info, Node: Changecom, Next: Changeword, Prev: Changequote, Up: Input Control
-
-Changing comment delimiters
-===========================
-
- The default comment delimiters can be changed with the builtin macro
-`changecom':
-
- changecom(opt START, opt END)
-
-where START is the new start-comment delimiter and END is the new
-end-comment delimiter. If any of the arguments are void, the default
-comment delimiters (`#' and newline) are used instead of the void
-arguments. The comment delimiters can be of any length.
-
- The expansion of `changecom' is void.
-
- define(`comment', `COMMENT')
- =>
- # A normal comment
- =># A normal comment
- changecom(`/*', `*/')
- =>
- # Not a comment anymore
- =># Not a COMMENT anymore
- But: /* this is a comment now */ while this is not a comment
- =>But: /* this is a comment now */ while this is not a COMMENT
-
- Note how comments are copied to the output, much as if they were
-quoted strings. If you want the text inside a comment expanded, quote
-the start comment delimiter.
-
- Calling `changecom' without any arguments disables the commenting
-mechanism completely.
-
- define(`comment', `COMMENT')
- =>
- changecom
- =>
- # Not a comment anymore
- =># Not a COMMENT anymore
-
-
-File: m4.info, Node: Changeword, Next: M4wrap, Prev: Changecom, Up: Input Control
-
-Changing the lexical structure of words
-=======================================
-
- The macro `changeword' and all associated functionnality is
- experimental. It is only available if the `--enable-changeword'
- option was given to `configure', at GNU `m4' installation time.
- The functionnality might change or even go away in the future.
- *Do not rely on it*. Please direct your comments about it the
- same way you would do for bugs.
-
- A file being processed by `m4' is split into quoted strings, words
-(potential macro names) and simple tokens (any other single character).
-Initially a word is defined by the following regular expression:
-
- [_a-zA-Z][_a-zA-Z0-9]*
-
- Using `changeword', you can change this regular expression. Relaxing
-`m4''s lexical rules might be useful (for example) if you wanted to
-apply translations to a file of numbers:
-
- changeword(`[_a-zA-Z0-9]+')
- define(1, 0)
- =>1
-
- Tightening the lexical rules is less useful, because it will
-generally make some of the builtins unavailable. You could use it to
-prevent accidental call of builtins, for example:
-
- define(`_indir', defn(`indir'))
- changeword(`_[_a-zA-Z0-9]*')
- esyscmd(foo)
- _indir(`esyscmd', `ls')
-
- Because `m4' constructs its words a character at a time, there is a
-restriction on the regular expressions that may be passed to
-`changeword'. This is that if your regular expression accepts `foo',
-it must also accept `f' and `fo'.
-
- `changeword' has another function. If the regular expression
-supplied contains any bracketed subexpressions, then text outside the
-first of these is discarded before symbol lookup. So:
-
- changecom(`/*', `*/')
- changeword(`#\([_a-zA-Z0-9]*\)')
- #esyscmd(ls)
-
- `m4' now requires a `#' mark at the beginning of every macro
-invocation, so one can use `m4' to preprocess shell scripts without
-getting `shift' commands swallowed, and plain text without losing
-various common words.
-
- `m4''s macro substitution is based on text, while TeX's is based on
-tokens. `changeword' can throw this difference into relief. For
-example, here is the same idea represented in TeX and `m4'. First, the
-TeX version:
-
- \def\a{\message{Hello}}
- \catcode`\@=0
- \catcode`\\=12
- =>@a
- =>@bye
-
-Then, the `m4' version:
-
- define(a, `errprint(`Hello')')
- changeword(`@\([_a-zA-Z0-9]*\)')
- =>@a
-
- In the TeX example, the first line defines a macro `a' to print the
-message `Hello'. The second line defines @ to be usable instead of \
-as an escape character. The third line defines \ to be a normal
-printing character, not an escape. The fourth line invokes the macro
-`a'. So, when TeX is run on this file, it displays the message `Hello'.
-
- When the `m4' example is passed through `m4', it outputs
-`errprint(Hello)'. The reason for this is that TeX does lexical
-analysis of macro definition when the macro is *defined*. `m4' just
-stores the text, postponing the lexical analysis until the macro is
-*used*.
-
- You should note that using `changeword' will slow `m4' down by a
-factor of about seven.
-
-
-File: m4.info, Node: M4wrap, Prev: Changeword, Up: Input Control
-
-Saving input
-============
-
- It is possible to `save' some text until the end of the normal input
-has been seen. Text can be saved, to be read again by `m4' when the
-normal input has been exhausted. This feature is normally used to
-initiate cleanup actions before normal exit, e.g., deleting temporary
-files.
-
- To save input text, use the builtin `m4wrap':
-
- m4wrap(STRING, ...)
-
-which stores STRING and the rest of the arguments in a safe place, to
-be reread when end of input is reached.
-
- define(`cleanup', `This is the `cleanup' actions.
- ')
- =>
- m4wrap(`cleanup')
- =>
- This is the first and last normal input line.
- =>This is the first and last normal input line.
- ^D
- =>This is the cleanup actions.
-
- The saved input is only reread when the end of normal input is seen,
-and not if `m4exit' is used to exit `m4'.
-
- It is safe to call `m4wrap' from saved text, but then the order in
-which the saved text is reread is undefined. If `m4wrap' is not used
-recursively, the saved pieces of text are reread in the opposite order
-in which they were saved (LIFO--last in, first out).
-
-
-File: m4.info, Node: File Inclusion, Next: Diversions, Prev: Input Control, Up: Top
-
-File inclusion
-**************
-
- `m4' allows you to include named files at any point in the input.
-
-* Menu:
-
-* Include:: Including named files
-* Search Path:: Searching for include files
-
-
-File: m4.info, Node: Include, Next: Search Path, Prev: File Inclusion, Up: File Inclusion
-
-Including named files
-=====================
-
- There are two builtin macros in `m4' for including files:
-
- include(FILENAME)
- sinclude(FILENAME)
-
-both of which cause the file named FILENAME to be read by `m4'. When
-the end of the file is reached, input is resumed from the previous
-input file.
-
- The expansion of `include' and `sinclude' is therefore the contents
-of FILENAME.
-
- It is an error for an `include'd file not to exist. If you do not
-want error messages about non-existent files, `sinclude' can be used to
-include a file, if it exists, expanding to nothing if it does not.
-
- include(`no-such-file')
- =>
- error-->30.include:2: m4: Cannot open no-such-file: No such file or directory
- sinclude(`no-such-file')
- =>
-
- Assume in the following that the file `incl.m4' contains the lines:
- Include file start
- foo
- Include file end
-
-Normally file inclusion is used to insert the contents of a file into
-the input stream. The contents of the file will be read by `m4' and
-macro calls in the file will be expanded:
-
- define(`foo', `FOO')
- =>
- include(`incl.m4')
- =>Include file start
- =>FOO
- =>Include file end
- =>
-
- The fact that `include' and `sinclude' expand to the contents of the
-file can be used to define macros that operate on entire files. Here
-is an example, which defines `bar' to expand to the contents of
-`incl.m4':
-
- define(`bar', include(`incl.m4'))
- =>
- This is `bar': >>>bar<<<
- =>This is bar: >>>Include file start
- =>foo
- =>Include file end
- =><<<
-
- This use of `include' is not trivial, though, as files can contain
-quotes, commas and parentheses, which can interfere with the way the
-`m4' parser works.
-
- The builtin macros `include' and `sinclude' are recognized only when
-given arguments.
-
-
-File: m4.info, Node: Search Path, Prev: Include, Up: File Inclusion
-
-Searching for include files
-===========================
-
- GNU `m4' allows included files to be found in other directories than
-the current working directory.
-
- If a file is not found in the current working directory, and the file
-name is not absolute, the file will be looked for in a specified search
-path. First, the directories specified with the `-I' option will be
-searched, in the order found on the command line. Second, if the
-`M4PATH' environment variable is set, it is expected to contain a
-colon-separated list of directories, which will be searched in order.
-
- If the automatic search for include-files causes trouble, the `p'
-debug flag (*note Debug Levels::.) can help isolate the problem.
-
-
-File: m4.info, Node: Diversions, Next: Text handling, Prev: File Inclusion, Up: Top
-
-Diverting and undiverting output
-********************************
-
- Diversions are a way of temporarily saving output. The output of
-`m4' can at any time be diverted to a temporary file, and be reinserted
-into the output stream, "undiverted", again at a later time.
-
- Numbered diversions are counted from 0 upwards, diversion number 0
-being the normal output stream. The number of simultaneous diversions
-is limited mainly by the memory used to describe them, because GNU `m4'
-tries to keep diversions in memory. However, there is a limit to the
-overall memory usable by all diversions taken altogether (512K,
-currently). When this maximum is about to be exceeded, a temporary
-file is opened to receive the contents of the biggest diversion still
-in memory, freeing this memory for other diversions. So, it is
-theoretically possible that the number of diversions be limited by the
-number of available file descriptors.
-
-* Menu:
-
-* Divert:: Diverting output
-* Undivert:: Undiverting output
-* Divnum:: Diversion numbers
-* Cleardiv:: Discarding diverted text
-
-
-File: m4.info, Node: Divert, Next: Undivert, Prev: Diversions, Up: Diversions
-
-Diverting output
-================
-
- Output is diverted using `divert':
-
- divert(opt NUMBER)
-
-where NUMBER is the diversion to be used. If NUMBER is left out, it is
-assumed to be zero.
-
- The expansion of `divert' is void.
-
- When all the `m4' input will have been processed, all existing
-diversions are automatically undiverted, in numerical order.
-
- divert(1)
- This text is diverted.
- divert
- =>
- This text is not diverted.
- =>This text is not diverted.
- ^D
- =>
- =>This text is diverted.
-
- Several calls of `divert' with the same argument do not overwrite
-the previous diverted text, but append to it.
-
- If output is diverted to a non-existent diversion, it is simply
-discarded. This can be used to suppress unwanted output. A common
-example of unwanted output is the trailing newlines after macro
-definitions. Here is how to avoid them.
-
- divert(-1)
- define(`foo', `Macro `foo'.')
- define(`bar', `Macro `bar'.')
- divert
- =>
-
- This is a common programming idiom in `m4'.
-
-
-File: m4.info, Node: Undivert, Next: Divnum, Prev: Divert, Up: Diversions
-
-Undiverting output
-==================
-
- Diverted text can be undiverted explicitly using the builtin
-`undivert':
-
- undivert(opt NUMBER, ...)
-
-which undiverts the diversions given by the arguments, in the order
-given. If no arguments are supplied, all diversions are undiverted, in
-numerical order.
-
- The expansion of `undivert' is void.
-
- divert(1)
- This text is diverted.
- divert
- =>
- This text is not diverted.
- =>This text is not diverted.
- undivert(1)
- =>
- =>This text is diverted.
- =>
-
- Notice the last two blank lines. One of them comes from the newline
-following `undivert', the other from the newline that followed the
-`divert'! A diversion often starts with a blank line like this.
-
- When diverted text is undiverted, it is *not* reread by `m4', but
-rather copied directly to the current output, and it is therefore not
-an error to undivert into a diversion.
-
- When a diversion has been undiverted, the diverted text is discarded,
-and it is not possible to bring back diverted text more than once.
-
- divert(1)
- This text is diverted first.
- divert(0)undivert(1)dnl
- =>
- =>This text is diverted first.
- undivert(1)
- =>
- divert(1)
- This text is also diverted but not appended.
- divert(0)undivert(1)dnl
- =>
- =>This text is also diverted but not appended.
-
- Attempts to undivert the current diversion are silently ignored.
-
- GNU `m4' allows named files to be undiverted. Given a non-numeric
-argument, the contents of the file named will be copied, uninterpreted,
-to the current output. This complements the builtin `include' (*note
-Include::.). To illustrate the difference, assume the file `foo'
-contains the word `bar':
-
- define(`bar', `BAR')
- =>
- undivert(`foo')
- =>bar
- =>
- include(`foo')
- =>BAR
- =>
-
-
-File: m4.info, Node: Divnum, Next: Cleardiv, Prev: Undivert, Up: Diversions
-
-Diversion numbers
-=================
-
- The builtin `divnum':
-
- divnum
-
-expands to the number of the current diversion.
-
- Initial divnum
- =>Initial 0
- divert(1)
- Diversion one: divnum
- divert(2)
- Diversion two: divnum
- divert
- =>
- ^D
- =>
- =>Diversion one: 1
- =>
- =>Diversion two: 2
-
- The last call of `divert' without argument is necessary, since the
-undiverted text would otherwise be diverted itself.
-
-
-File: m4.info, Node: Cleardiv, Prev: Divnum, Up: Diversions
-
-Discarding diverted text
-========================
-
- Often it is not known, when output is diverted, whether the diverted
-text is actually needed. Since all non-empty diversion are brought back
-on the main output stream when the end of input is seen, a method of
-discarding a diversion is needed. If all diversions should be
-discarded, the easiest is to end the input to `m4' with `divert(-1)'
-followed by an explicit `undivert':
-
- divert(1)
- Diversion one: divnum
- divert(2)
- Diversion two: divnum
- divert(-1)
- undivert
- ^D
-
-No output is produced at all.
-
- Clearing selected diversions can be done with the following macro:
-
- define(`cleardivert',
- `pushdef(`_num', divnum)divert(-1)undivert($@)divert(_num)popdef(`_num')')
- =>
-
- It is called just like `undivert', but the effect is to clear the
-diversions, given by the arguments. (This macro has a nasty bug! You
-should try to see if you can find it and correct it.)
-
-
-File: m4.info, Node: Text handling, Next: Arithmetic, Prev: Diversions, Up: Top
-
-Macros for text handling
-************************
-
- There are a number of builtins in `m4' for manipulating text in
-various ways, extracting substrings, searching, substituting, and so on.
-
-* Menu:
-
-* Len:: Calculating length of strings
-* Index:: Searching for substrings
-* Regexp:: Searching for regular expressions
-* Substr:: Extracting substrings
-* Translit:: Translating characters
-* Patsubst:: Substituting text by regular expression
-* Format:: Formatting strings (printf-like)
-
-
-File: m4.info, Node: Len, Next: Index, Prev: Text handling, Up: Text handling
-
-Calculating length of strings
-=============================
-
- The length of a string can be calculated by `len':
-
- len(STRING)
-
-which expands to the length of STRING, as a decimal number.
-
- len()
- =>0
- len(`abcdef')
- =>6
-
- The builtin macro `len' is recognized only when given arguments.
-
-
-File: m4.info, Node: Index, Next: Regexp, Prev: Len, Up: Text handling
-
-Searching for substrings
-========================
-
- Searching for substrings is done with `index':
-
- index(STRING, SUBSTRING)
-
-which expands to the index of the first occurrence of SUBSTRING in
-STRING. The first character in STRING has index 0. If SUBSTRING does
-not occur in STRING, `index' expands to `-1'.
-
- index(`gnus, gnats, and armadillos', `nat')
- =>7
- index(`gnus, gnats, and armadillos', `dag')
- =>-1
-
- The builtin macro `index' is recognized only when given arguments.
-
-
-File: m4.info, Node: Regexp, Next: Substr, Prev: Index, Up: Text handling
-
-Searching for regular expressions
-=================================
-
- Searching for regular expressions is done with the builtin `regexp':
-
- regexp(STRING, REGEXP, opt REPLACEMENT)
-
-which searches for REGEXP in STRING. The syntax for regular
-expressions is the same as in GNU Emacs. *Note Syntax of Regular
-Expressions: (emacs)Regexps.
-
- If REPLACEMENT is omitted, `regexp' expands to the index of the
-first match of REGEXP in STRING. If REGEXP does not match anywhere in
-STRING, it expands to -1.
-
- regexp(`GNUs not Unix', `\<[a-z]\w+')
- =>5
- regexp(`GNUs not Unix', `\<Q\w*')
- =>-1
-
- If REPLACEMENT is supplied, `regexp' changes the expansion to this
-argument, with `\N' substituted by the text matched by the Nth
-parenthesized sub-expression of REGEXP, `\&' being the text the entire
-regular expression matched.
-
- regexp(`GNUs not Unix', `\w\(\w+\)$', `*** \& *** \1 ***')
- =>*** Unix *** nix ***
-
- The builtin macro `regexp' is recognized only when given arguments.
-
-
-File: m4.info, Node: Substr, Next: Translit, Prev: Regexp, Up: Text handling
-
-Extracting substrings
-=====================
-
- Substrings are extracted with `substr':
-
- substr(STRING, FROM, opt LENGTH)
-
-which expands to the substring of STRING, which starts at index FROM,
-and extends for LENGTH characters, or to the end of STRING, if LENGTH
-is omitted. The starting index of a string is always 0.
-
- substr(`gnus, gnats, and armadillos', 6)
- =>gnats, and armadillos
- substr(`gnus, gnats, and armadillos', 6, 5)
- =>gnats
-
- The builtin macro `substr' is recognized only when given arguments.
-
-
-File: m4.info, Node: Translit, Next: Patsubst, Prev: Substr, Up: Text handling
-
-Translating characters
-======================
-
- Character translation is done with `translit':
-
- translit(STRING, CHARS, REPLACEMENT)
-
-which expands to STRING, with each character that occurs in CHARS
-translated into the character from REPLACEMENT with the same index.
-
- If REPLACEMENT is shorter than CHARS, the excess characters are
-deleted from the expansion. If REPLACEMENT is omitted, all characters
-in STRING, that are present in CHARS are deleted from the expansion.
-
- Both CHARS and REPLACEMENT can contain character-ranges, e.g., `a-z'
-(meaning all lowercase letters) or `0-9' (meaning all digits). To
-include a dash `-' in CHARS or REPLACEMENT, place it first or last.
-
- It is not an error for the last character in the range to be `larger'
-than the first. In that case, the range runs backwards, i.e., `9-0'
-means the string `9876543210'.
-
- translit(`GNUs not Unix', `A-Z')
- =>s not nix
- translit(`GNUs not Unix', `a-z', `A-Z')
- =>GNUS NOT UNIX
- translit(`GNUs not Unix', `A-Z', `z-a')
- =>tmfs not fnix
-
- The first example deletes all uppercase letters, the second converts
-lowercase to uppercase, and the third `mirrors' all uppercase letters,
-while converting them to lowercase. The two first cases are by far the
-most common.
-
- The builtin macro `translit' is recognized only when given arguments.
-
-
-File: m4.info, Node: Patsubst, Next: Format, Prev: Translit, Up: Text handling
-
-Substituting text by regular expression
-=======================================
-
- Global substitution in a string is done by `patsubst':
-
- patsubst(STRING, REGEXP, opt REPLACEMENT)
-
-which searches STRING for matches of REGEXP, and substitutes
-REPLACEMENT for each match. The syntax for regular expressions is the
-same as in GNU Emacs.
-
- The parts of STRING that are not covered by any match of REGEXP are
-copied to the expansion. Whenever a match is found, the search
-proceeds from the end of the match, so a character from STRING will
-never be substituted twice. If REGEXP matches a string of zero length,
-the start position for the search is incremented, to avoid infinite
-loops.
-
- When a replacement is to be made, REPLACEMENT is inserted into the
-expansion, with `\N' substituted by the text matched by the Nth
-parenthesized sub-expression of REGEXP, `\&' being the text the entire
-regular expression matched.
-
- The REPLACEMENT argument can be omitted, in which case the text
-matched by REGEXP is deleted.
-
- patsubst(`GNUs not Unix', `^', `OBS: ')
- =>OBS: GNUs not Unix
- patsubst(`GNUs not Unix', `\<', `OBS: ')
- =>OBS: GNUs OBS: not OBS: Unix
- patsubst(`GNUs not Unix', `\w*', `(\&)')
- =>(GNUs)() (not)() (Unix)
- patsubst(`GNUs not Unix', `\w+', `(\&)')
- =>(GNUs) (not) (Unix)
- patsubst(`GNUs not Unix', `[A-Z][a-z]+')
- =>GN not
-
- Here is a slightly more realistic example, which capitalizes
-individual word or whole sentences, by substituting calls of the macros
-`upcase' and `downcase' into the strings.
-
- define(`upcase', `translit(`$*', `a-z', `A-Z')')dnl
- define(`downcase', `translit(`$*', `A-Z', `a-z')')dnl
- define(`capitalize1',
- `regexp(`$1', `^\(\w\)\(\w*\)', `upcase(`\1')`'downcase(`\2')')')dnl
- define(`capitalize',
- `patsubst(`$1', `\w+', `capitalize1(`\&')')')dnl
- capitalize(`GNUs not Unix')
- =>Gnus Not Unix
-
- The builtin macro `patsubst' is recognized only when given arguments.
-
-
-File: m4.info, Node: Format, Prev: Patsubst, Up: Text handling
-
-Formatted output
-================
-
- Formatted output can be made with `format':
-
- format(FORMAT-STRING, ...)
-
-which works much like the C function `printf'. The first argument is a
-format string, which can contain `%' specifications, and the expansion
-of `format' is the formatted string.
-
- Its use is best described by a few examples:
-
- define(`foo', `The brown fox jumped over the lazy dog')
- =>
- format(`The string "%s" is %d characters long', foo, len(foo))
- =>The string "The brown fox jumped over the lazy dog" is 38 characters long
-
- Using the `forloop' macro defined in *Note Loops::, this example
-shows how `format' can be used to produce tabular output.
-
- forloop(`i', 1, 10, `format(`%6d squared is %10d
- ', i, eval(i**2))')
- => 1 squared is 1
- => 2 squared is 4
- => 3 squared is 9
- => 4 squared is 16
- => 5 squared is 25
- => 6 squared is 36
- => 7 squared is 49
- => 8 squared is 64
- => 9 squared is 81
- => 10 squared is 100
-
- The builtin `format' is modeled after the ANSI C `printf' function,
-and supports the normal `%' specifiers: `c', `s', `d', `o', `x', `X',
-`u', `e', `E' and `f'; it supports field widths and precisions, and the
-modifiers `+', `-', ` ', `0', `#', `h' and `l'. For more details on
-the functioning of `printf', see the C Library Manual.
-
-
-File: m4.info, Node: Arithmetic, Next: UNIX commands, Prev: Text handling, Up: Top
-
-Macros for doing arithmetic
-***************************
-
- Integer arithmetic is included in `m4', with a C-like syntax. As
-convenient shorthands, there are builtins for simple increment and
-decrement operations.
-
-* Menu:
-
-* Incr:: Decrement and increment operators
-* Eval:: Evaluating integer expressions
-
-
-File: m4.info, Node: Incr, Next: Eval, Prev: Arithmetic, Up: Arithmetic
-
-Decrement and increment operators
-=================================
-
- Increment and decrement of integers are supported using the builtins
-`incr' and `decr':
-
- incr(NUMBER)
- decr(NUMBER)
-
-which expand to the numerical value of NUMBER, incremented, or
-decremented, respectively, by one.
-
- incr(4)
- =>5
- decr(7)
- =>6
-
- The builtin macros `incr' and `decr' are recognized only when given
-arguments.
-
-
-File: m4.info, Node: Eval, Prev: Incr, Up: Arithmetic
-
-Evaluating integer expressions
-==============================
-
- Integer expressions are evaluated with `eval':
-
- eval(EXPRESSION, opt RADIX, opt WIDTH)
-
-which expands to the value of EXPRESSION.
-
- Expressions can contain the following operators, listed in order of
-decreasing precedence.
-
-`-'
- Unary minus
-
-`**'
- Exponentiation
-
-`* / %'
- Multiplication, division and modulo
-
-`+ -'
- Addition and subtraction
-
-`<< >>'
- Shift left or right
-
-`== != > >= < <='
- Relational operators
-
-`!'
- Logical negation
-
-`~'
- Bitwise negation
-
-`&'
- Bitwise and
-
-`^'
- Bitwise exclusive-or
-
-`|'
- Bitwise or
-
-`&&'
- Logical and
-
-`||'
- Logical or
-
- All operators, except exponentiation, are left associative.
-
- Note that many `m4' implementations use `^' as an alternate operator
-for the exponentiation, while many others use `^' for the bitwise
-exclusive-or. GNU `m4' changed its behavior: it used to exponentiate
-for `^', it now computes the bitwise exclusive-or.
-
- Numbers without special prefix are given decimal. A simple `0'
-prefix introduces an octal number. `0x' introduces an hexadecimal
-number. `0b' introduces a binary number. `0r' introduces a number
-expressed in any radix between 1 and 36: the prefix should be
-immediately followed by the decimal expression of the radix, a colon,
-then the digits making the number. For any radix, the digits are `0',
-`1', `2', .... Beyond `9', the digits are `a', `b' ... up to `z'.
-Lower and upper case letters can be used interchangeably in numbers
-prefixes and as number digits.
-
- Parentheses may be used to group subexpressions whenever needed.
-For the relational operators, a true relation returns `1', and a false
-relation return `0'.
-
- Here are a few examples of use of `eval'.
-
- eval(-3 * 5)
- =>-15
- eval(index(`Hello world', `llo') >= 0)
- =>1
- define(`square', `eval(($1)**2)')
- =>
- square(9)
- =>81
- square(square(5)+1)
- =>676
- define(`foo', `666')
- =>
- eval(`foo'/6)
- error-->51.eval:14: m4: Bad expression in eval: foo/6
- =>
- eval(foo/6)
- =>111
-
- As the second to last example shows, `eval' does not handle macro
-names, even if they expand to a valid expression (or part of a valid
-expression). Therefore all macros must be expanded before they are
-passed to `eval'.
-
- If RADIX is specified, it specifies the radix to be used in the
-expansion. The default radix is 10. The result of `eval' is always
-taken to be signed. The WIDTH argument specifies a minimum output
-width. The result is zero-padded to extend the expansion to the
-requested width.
-
- eval(666, 10)
- =>666
- eval(666, 11)
- =>556
- eval(666, 6)
- =>3030
- eval(666, 6, 10)
- =>0000003030
- eval(-666, 6, 10)
- =>-000003030
-
- Take note that RADIX cannot be larger than 36.
-
- The builtin macro `eval' is recognized only when given arguments.
-
-
-File: m4.info, Node: UNIX commands, Next: Miscellaneous, Prev: Arithmetic, Up: Top
-
-Running UNIX commands
-*********************
-
- There are a few builtin macros in `m4' that allow you to run UNIX
-commands from within `m4'.
-
-* Menu:
-
-* Syscmd:: Executing simple commands
-* Esyscmd:: Reading the output of commands
-* Sysval:: Exit codes
-* Maketemp:: Making names for temporary files
-
-
-File: m4.info, Node: Syscmd, Next: Esyscmd, Prev: UNIX commands, Up: UNIX commands
-
-Executing simple commands
-=========================
-
- Any shell command can be executed, using `syscmd':
-
- syscmd(SHELL-COMMAND)
-
-which executes SHELL-COMMAND as a shell command.
-
- The expansion of `syscmd' is void, *not* the output from
-SHELL-COMMAND! Output or error messages from SHELL-COMMAND are not
-read by `m4'. *Note Esyscmd:: if you need to process the command
-output.
-
- Prior to executing the command, `m4' flushes its output buffers.
-The default standard input, output and error of SHELL-COMMAND are the
-same as those of `m4'.
-
- The builtin macro `syscmd' is recognized only when given arguments.
-
-
-File: m4.info, Node: Esyscmd, Next: Sysval, Prev: Syscmd, Up: UNIX commands
-
-Reading the output of commands
-==============================
-
- If you want `m4' to read the output of a UNIX command, use `esyscmd':
-
- esyscmd(SHELL-COMMAND)
-
-which expands to the standard output of the shell command SHELL-COMMAND.
-
- Prior to executing the command, `m4' flushes its output buffers.
-The default standard input and error output of SHELL-COMMAND are the
-same as those of `m4'. The error output of SHELL-COMMAND is not a part
-of the expansion: it will appear along with the error output of `m4'.
-
- Assume you are positioned into the `checks' directory of GNU `m4'
-distribution, then:
-
- define(`vice', `esyscmd(grep Vice ../COPYING)')
- =>
- vice
- => Ty Coon, President of Vice
- =>
-
- Note how the expansion of `esyscmd' has a trailing newline.
-
- The builtin macro `esyscmd' is recognized only when given arguments.
-
-
-File: m4.info, Node: Sysval, Next: Maketemp, Prev: Esyscmd, Up: UNIX commands
-
-Exit codes
-==========
-
- To see whether a shell command succeeded, use `sysval':
-
- sysval
-
-which expands to the exit status of the last shell command run with
-`syscmd' or `esyscmd'.
-
- syscmd(`false')
- =>
- ifelse(sysval, 0, zero, non-zero)
- =>non-zero
- syscmd(`true')
- =>
- sysval
- =>0
-
-
-File: m4.info, Node: Maketemp, Prev: Sysval, Up: UNIX commands
-
-Making names for temporary files
-================================
-
- Commands specified to `syscmd' or `esyscmd' might need a temporary
-file, for output or for some other purpose. There is a builtin macro,
-`maketemp', for making temporary file names:
-
- maketemp(TEMPLATE)
-
-which expands to a name of a non-existent file, made from the string
-TEMPLATE, which should end with the string `XXXXXX'. The six `X''s are
-then replaced, usually with something that includes the process id of
-the `m4' process, in order to make the filename unique.
-
- maketemp(`/tmp/fooXXXXXX')
- =>/tmp/fooa07346
- maketemp(`/tmp/fooXXXXXX')
- =>/tmp/fooa07346
-
- As seen in the example, several calls of `maketemp' might expand to
-the same string, since the selection criteria is whether the file exists
-or not. If a file has not been created before the next call, the two
-macro calls might expand to the same name.
-
- The builtin macro `maketemp' is recognized only when given arguments.
-
-
-File: m4.info, Node: Miscellaneous, Next: Frozen files, Prev: UNIX commands, Up: Top
-
-Miscellaneous builtin macros
-****************************
-
- This chapter describes various builtins, that do not really belong in
-any of the previous chapters.
-
-* Menu:
-
-* Errprint:: Printing error messages
-* M4exit:: Exiting from m4
-
-
-File: m4.info, Node: Errprint, Next: M4exit, Prev: Miscellaneous, Up: Miscellaneous
-
-Printing error messages
-=======================
-
- You can print error messages using `errprint':
-
- errprint(MESSAGE, ...)
-
-which simply prints MESSAGE and the rest of the arguments on the
-standard error output.
-
- The expansion of `errprint' is void.
-
- errprint(`Illegal arguments to forloop
- ')
- error-->Illegal arguments to forloop
- =>
-
- A trailing newline is *not* printed automatically, so it must be
-supplied as part of the argument, as in the example. (BSD flavored
-`m4''s do append a trailing newline on each `errprint' call).
-
- To make it possible to specify the location of the error, two
-utility builtins exist:
-
- __file__
- __line__
-
-which expands to the quoted name of the current input file, and the
-current input line number in that file.
-
- errprint(`m4:'__file__:__line__: `Input error
- ')
- error-->m4:56.errprint:2: Input error
- =>
-
-
-File: m4.info, Node: M4exit, Prev: Errprint, Up: Miscellaneous
-
-Exiting from `m4'
-=================
-
- If you need to exit from `m4' before the entire input has been read,
-you can use `m4exit':
-
- m4exit(opt CODE)
-
-which causes `m4' to exit, with exit code CODE. If CODE is left out,
-the exit code is zero.
-
- define(`fatal_error', `errprint(`m4: '__file__: __line__`: fatal error: $*
- ')m4exit(1)')
- =>
- fatal_error(`This is a BAD one, buster')
- error-->m4: 57.m4exit: 5: fatal error: This is a BAD one, buster
-
- After this macro call, `m4' will exit with exit code 1. This macro
-is only intended for error exits, since the normal exit procedures are
-not followed, e.g., diverted text is not undiverted, and saved text
-(*note M4wrap::.) is not reread.
-
-
-File: m4.info, Node: Frozen files, Next: Compatibility, Prev: Miscellaneous, Up: Top
-
-Fast loading of frozen states
-*****************************
-
- Some bigger `m4' applications may be built over a common base
-containing hundreds of definitions and other costly initializations.
-Usually, the common base is kept in one or more declarative files,
-which files are listed on each `m4' invocation prior to the user's
-input file, or else, `include''d from this input file.
-
- Reading the common base of a big application, over and over again,
-may be time consuming. GNU `m4' offers some machinery to speed up the
-start of an application using lengthy common bases. Presume the user
-repeatedly uses:
-
- m4 base.m4 input.m4
-
-with a varying contents of `input.m4', but a rather fixed contents for
-`base.m4'. Then, the user might rather execute:
-
- m4 -F base.m4f base.m4
-
-once, and further execute, as often as needed:
-
- m4 -R base.m4f input.m4
-
-with the varying input. The first call, containing the `-F' option,
-only reads and executes file `base.m4', so defining various application
-macros and computing other initializations. Only once the input file
-`base.m4' has been completely processed, GNU `m4' produces on
-`base.m4f' a "frozen" file, that is, a file which contains a kind of
-snapshot of the `m4' internal state.
-
- Later calls, containing the `-R' option, are able to reload the
-internal state of `m4''s memory, from `base.m4f', *prior* to reading
-any other input files. By this mean, instead of starting with a virgin
-copy of `m4', input will be read after having effectively recovered the
-effect of a prior run. In our example, the effect is the same as if
-file `base.m4' has been read anew. However, this effect is achieved a
-lot faster.
-
- Only one frozen file may be created or read in any one `m4'
-invocation. It is not possible to recover two frozen files at once.
-However, frozen files may be updated incrementally, through using `-R'
-and `-F' options simultaneously. For example, if some care is taken,
-the command:
-
- m4 file1.m4 file2.m4 file3.m4 file4.m4
-
-could be broken down in the following sequence, accumulating the same
-output:
-
- m4 -F file1.m4f file1.m4
- m4 -R file1.m4f -F file2.m4f file2.m4
- m4 -R file2.m4f -F file3.m4f file3.m4
- m4 -R file3.m4f file4.m4
-
- Some care is necessary because not every effort has been made for
-this to work in all cases. In particular, the trace attribute of
-macros is not handled, nor the current setting of `changeword'. Also,
-interactions for some options of `m4' being used in one call and not
-for the next, have not been fully analyzed yet. On the other end, you
-may be confident that stacks of `pushdef''ed definitions are handled
-correctly, so are `undefine''d or renamed builtins, changed strings for
-quotes or comments.
-
- When an `m4' run is to be frozen, the automatic undiversion which
-takes place at end of execution is inhibited. Instead, all positively
-numbered diversions are saved into the frozen file. The active
-diversion number is also transmitted.
-
- A frozen file to be reloaded need not reside in the current
-directory. It is looked up the same way as an `include' file (*note
-Search Path::.).
-
- Frozen files are sharable across architectures. It is safe to write
-a frozen file one one machine and read it on another, given that the
-second machine uses the same, or a newer version of GNU `m4'. These
-are simple (editable) text files, made up of directives, each starting
-with a capital letter and ending with a newline (NL). Wherever a
-directive is expected, the character `#' introduces a comment line,
-empty lines are also ignored. In the following descriptions, LENGTHs
-always refer to corresponding STRINGs. Numbers are always expressed in
-decimal. The directives are:
-
-`V NUMBER NL'
- Confirms the format of the file. NUMBER should be 1.
-
-`C LENGTH1 , LENGTH2 NL STRING1 STRING2 NL'
- Uses STRING1 and STRING2 as the beginning comment and end comment
- strings.
-
-`Q LENGTH1 , LENGTH2 NL STRING1 STRING2 NL'
- Uses STRING1 and STRING2 as the beginning quote and end quote
- strings.
-
-`F LENGTH1 , LENGTH2 NL STRING1 STRING2 NL'
- Defines, through `pushdef', a definition for STRING1 expanding to
- the function whose builtin name is STRING2.
-
-`T LENGTH1 , LENGTH2 NL STRING1 STRING2 NL'
- Defines, though `pushdef', a definition for STRING1 expanding to
- the text given by STRING2.
-
-`D NUMBER, LENGTH NL STRING NL'
- Selects diversion NUMBER, making it current, then copy STRING in
- the current diversion. NUMBER may be a negative number for a
- non-existing diversion. To merely specify an active selection,
- use this command with an empty STRING. With 0 as the diversion
- NUMBER, STRING will be issued on standard output at reload time,
- however this may not be produced from within `m4'.
-
-
-File: m4.info, Node: Compatibility, Next: Concept index, Prev: Frozen files, Up: Top
-
-Compatibility with other versions of `m4'
-*****************************************
-
- This chapter describes the differences between this implementation of
-`m4', and the implementation found under UNIX, notably System V,
-Release 3.
-
- There are also differences in BSD flavors of `m4'. No attempt is
-made to summarize these here.
-
-* Menu:
-
-* Extensions:: Extensions in GNU m4
-* Incompatibilities:: Facilities in System V m4 not in GNU m4
-* Other Incompat:: Other incompatibilities
-
-
-File: m4.info, Node: Extensions, Next: Incompatibilities, Prev: Compatibility, Up: Compatibility
-
-Extensions in GNU `m4'
-======================
-
- This version of `m4' contains a few facilities, that do not exist in
-System V `m4'. These extra facilities are all suppressed by using the
-`-G' command line option, unless overridden by other command line
-options.
-
- * In the `$'N notation for macro arguments, N can contain several
- digits, while the System V `m4' only accepts one digit. This
- allows macros in GNU `m4' to take any number of arguments, and not
- only nine (*note Arguments::.).
-
- * Files included with `include' and `sinclude' are sought in a user
- specified search path, if they are not found in the working
- directory. The search path is specified by the `-I' option and the
- `M4PATH' environment variable (*note Search Path::.).
-
- * Arguments to `undivert' can be non-numeric, in which case the named
- file will be included uninterpreted in the output (*note
- Undivert::.).
-
- * Formatted output is supported through the `format' builtin, which
- is modeled after the C library function `printf' (*note Format::.).
-
- * Searches and text substitution through regular expressions are
- supported by the `regexp' (*note Regexp::.) and `patsubst' (*note
- Patsubst::.) builtins.
-
- * The output of shell commands can be read into `m4' with `esyscmd'
- (*note Esyscmd::.).
-
- * There is indirect access to any builtin macro with `builtin'
- (*note Builtin::.).
-
- * Macros can be called indirectly through `indir' (*note Indir::.).
-
- * The name of the current input file and the current input line
- number are accessible through the builtins `__file__' and
- `__line__' (*note Errprint::.).
-
- * The format of the output from `dumpdef' and macro tracing can be
- controlled with `debugmode' (*note Debug Levels::.).
-
- * The destination of trace and debug output can be controlled with
- `debugfile' (*note Debug Output::.).
-
- In addition to the above extensions, GNU `m4' implements the
-following command line options: `-F', `-G', `-I', `-L', `-R', `-V',
-`-W', `-d', `-l', `-o' and `-t'. *Note Invoking m4::, for a
-description of these options.
-
- Also, the debugging and tracing facilities in GNU `m4' are much more
-extensive than in most other versions of `m4'.
-
-
-File: m4.info, Node: Incompatibilities, Next: Other Incompat, Prev: Extensions, Up: Compatibility
-
-Facilities in System V `m4' not in GNU `m4'
-===========================================
-
- The version of `m4' from System V contains a few facilities that
-have not been implemented in GNU `m4' yet.
-
- * System V `m4' supports multiple arguments to `defn'. This is not
- implemented in GNU `m4'. Its usefulness is unclear to me.
-
-
-File: m4.info, Node: Other Incompat, Prev: Incompatibilities, Up: Compatibility
-
-Other incompatibilities
-=======================
-
- There are a few other incompatibilities between this implementation
-of `m4', and the System V version.
-
- * GNU `m4' implements sync lines differently from System V `m4',
- when text is being diverted. GNU `m4' outputs the sync lines when
- the text is being diverted, and System V `m4' when the diverted
- text is being brought back.
-
- The problem is which lines and filenames should be attached to
- text that is being, or has been, diverted. System V `m4' regards
- all the diverted text as being generated by the source line
- containing the `undivert' call, whereas GNU `m4' regards the
- diverted text as being generated at the time it is diverted.
-
- I expect the sync line option to be used mostly when using `m4' as
- a front end to a compiler. If a diverted line causes a compiler
- error, the error messages should most probably refer to the place
- where the diversion were made, and not where it was inserted again.
-
- * GNU `m4' makes no attempt at prohiting autoreferential definitions
- like:
-
- define(`x', `x')
- define(`x', `x ')
-
- There is nothing inherently wrong with defining `x' to return `x'.
- The wrong thing is to expand `x' unquoted. In `m4', one might
- use macros to hold strings, as we do for variables in other
- programming languages, further checking them with:
-
- ifelse(defn(`HOLDER'), `VALUE', ...)
-
- In cases like this one, an interdiction for a macro to hold its own
- name would be a useless limitation. Of course, this leave more
- rope for the GNU `m4' user to hang himself! Rescanning hangs may
- be avoided through careful programming, a little like for endless
- loops in traditional programming languages.
-
- * GNU `m4' without `-G' option will define the macro `__gnu__' to
- expand to the empty string.
-
- On UNIX systems, GNU `m4' without the `-G' option will define the
- macro `__unix__', otherwise the macro `unix'. Both will expand to
- the empty string.
-
diff --git a/doc/m4.info-3 b/doc/m4.info-3
deleted file mode 100644
index c21385ea..00000000
--- a/doc/m4.info-3
+++ /dev/null
@@ -1,227 +0,0 @@
-This is Info file m4.info, produced by Makeinfo-1.55 from the input
-file m4.texinfo.
-
-START-INFO-DIR-ENTRY
-* m4: (m4). A powerful macro processor.
-END-INFO-DIR-ENTRY
-
- This file documents the GNU `m4' utility.
-
- Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994 Free Software
-Foundation, Inc.
-
- Permission is granted to make and distribute verbatim copies of this
-manual provided the copyright notice and this permission notice are
-preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
-this manual under the conditions for verbatim copying, provided that
-the entire resulting derived work is distributed under the terms of a
-permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
-manual into another language, under the above conditions for modified
-versions, except that this permission notice may be stated in a
-translation approved by the Foundation.
-
-
-File: m4.info, Node: Concept index, Next: Macro index, Prev: Compatibility, Up: Top
-
-Concept index
-*************
-
-* Menu:
-
-* Arguments to macros: Arguments.
-* arguments to macros: Macro Arguments.
-* arguments to macros, special: Pseudo Arguments.
-* arguments, quoted macro: Quoting Arguments.
-* arithmetic: Arithmetic.
-* builtins, indirect call of: Builtin.
-* call of builtins, indirect: Builtin.
-* call of macros, indirect: Indir.
-* changing comment delimiters: Changecom.
-* changing the quote delimiters: Changequote.
-* characters, translating: Translit.
-* command line, filenames on the: Invoking m4.
-* command line, macro definitions on the: Invoking m4.
-* command line, options: Invoking m4.
-* commands, exit code from UNIX: Sysval.
-* commands, running UNIX: UNIX commands.
-* comment delimiters, changing: Changecom.
-* comments: Comments.
-* comments, copied to output: Changecom.
-* comparing strings: Ifelse.
-* compatibility: Compatibility.
-* conditionals: Ifdef.
-* controlling debugging output: Debug Levels.
-* counting loops: Loops.
-* debugging output, controlling: Debug Levels.
-* debugging output, saving: Debug Output.
-* decrement operator: Incr.
-* defining new macros: Definitions.
-* definitions, displaying macro: Dumpdef.
-* deleting macros: Undefine.
-* deleting whitespace in input: Dnl.
-* discarding diverted text: Cleardiv.
-* displaying macro definitions: Dumpdef.
-* diversion numbers: Divnum.
-* diverted text, discarding: Cleardiv.
-* diverting output to files: Divert.
-* dumping into frozen file: Frozen files.
-* error messages, printing: Errprint.
-* evaluation, of integer expressions: Eval.
-* executing UNIX commands: UNIX commands.
-* exit code from UNIX commands: Sysval.
-* exiting from m4: M4exit.
-* expansion of macros: Macro expansion.
-* expansion, tracing macro: Trace.
-* expressions, evaluation of integer: Eval.
-* extracting substrings: Substr.
-* fast loading of frozen files: Frozen files.
-* file inclusion: Undivert.
-* file inclusion: File Inclusion.
-* filenames, on the command line: Invoking m4.
-* files, diverting output to: Divert.
-* files, names of temporary: Maketemp.
-* forloops: Loops.
-* formatted output: Format.
-* frozen files for fast loading: Frozen files.
-* GNU extensions: Extensions.
-* GNU extensions: Frozen files.
-* GNU extensions: Esyscmd.
-* GNU extensions: Format.
-* GNU extensions: Patsubst.
-* GNU extensions: Regexp.
-* GNU extensions: Undivert.
-* GNU extensions: Search Path.
-* GNU extensions: Debug Output.
-* GNU extensions: Debug Levels.
-* GNU extensions: Builtin.
-* GNU extensions: Indir.
-* GNU extensions: Arguments.
-* included files, search path for: Search Path.
-* inclusion, of files: Undivert.
-* inclusion, of files: File Inclusion.
-* increment operator: Incr.
-* indirect call of builtins: Builtin.
-* indirect call of macros: Indir.
-* initialization, frozen states: Frozen files.
-* input tokens: Syntax.
-* input, saving: M4wrap.
-* integer arithmetic: Arithmetic.
-* integer expression evaluation: Eval.
-* length of strings: Len.
-* lexical structure of words: Changeword.
-* loops: Loops.
-* loops, counting: Loops.
-* macro definitions, on the command line: Invoking m4.
-* macro expansion, tracing: Trace.
-* macro invocation: Invocation.
-* macros, arguments to: Arguments.
-* macros, arguments to: Macro Arguments.
-* macros, displaying definitions: Dumpdef.
-* macros, expansion of: Macro expansion.
-* macros, how to define new: Definitions.
-* macros, how to delete: Undefine.
-* macros, how to rename: Defn.
-* macros, indirect call of: Indir.
-* macros, quoted arguments to: Quoting Arguments.
-* macros, recursive: Loops.
-* macros, special arguments to: Pseudo Arguments.
-* macros, temporary redefinition of: Pushdef.
-* messages, printing error: Errprint.
-* multibranches: Ifelse.
-* names: Names.
-* options, command line: Invoking m4.
-* output, diverting to files: Divert.
-* output, formatted: Format.
-* output, saving debugging: Debug Output.
-* pattern substitution: Patsubst.
-* printing error messages: Errprint.
-* quote delimiters, changing the: Changequote.
-* quoted macro arguments: Quoting Arguments.
-* quoted string: Quoted strings.
-* recursive macros: Loops.
-* redefinition of macros, temporary: Pushdef.
-* regular expressions: Patsubst.
-* regular expressions: Regexp.
-* reloading a frozen file: Frozen files.
-* renaming macros: Defn.
-* running UNIX commands: UNIX commands.
-* saving debugging output: Debug Output.
-* saving input: M4wrap.
-* search path for included files: Search Path.
-* special arguments to macros: Pseudo Arguments.
-* strings, length of: Len.
-* substitution by regular expression: Patsubst.
-* substrings, extracting: Substr.
-* temporary filenames: Maketemp.
-* temporary redefinition of macros: Pushdef.
-* tokens: Syntax.
-* tracing macro expansion: Trace.
-* translating characters: Translit.
-* undefining macros: Undefine.
-* UNIX commands, exit code from: Sysval.
-* UNIX commands, running: UNIX commands.
-* words, lexical structure of: Changeword.
-
-
-File: m4.info, Node: Macro index, Prev: Concept index, Up: Top
-
-Macro index
-***********
-
- References are exclusively to the places where a builtin is
-introduced the first time. Names starting and ending with `__' have
-these characters removed in the index.
-
-* Menu:
-
-* builtin: Builtin.
-* changecom: Changecom.
-* changequote: Changequote.
-* changeword: Changeword.
-* debugfile: Debug Output.
-* debugmode: Debug Levels.
-* decr: Incr.
-* define: Define.
-* defn: Defn.
-* divert: Divert.
-* divnum: Divnum.
-* dnl: Dnl.
-* dumpdef: Dumpdef.
-* errprint: Errprint.
-* esyscmd: Esyscmd.
-* eval: Eval.
-* file: Errprint.
-* format: Format.
-* gnu: Other Incompat.
-* ifdef: Ifdef.
-* ifelse: Ifelse.
-* include: Include.
-* incr: Incr.
-* index: Index.
-* indir: Indir.
-* len: Len.
-* line: Errprint.
-* m4exit: M4exit.
-* m4wrap: M4wrap.
-* maketemp: Maketemp.
-* patsubst: Patsubst.
-* popdef: Pushdef.
-* pushdef: Pushdef.
-* regexp: Regexp.
-* shift: Loops.
-* sinclude: Include.
-* substr: Substr.
-* syscmd: Syscmd.
-* sysval: Sysval.
-* traceoff: Trace.
-* traceon: Trace.
-* translit: Translit.
-* undefine: Undefine.
-* undivert: Undivert.
-* unix: Other Incompat.
-
-
diff --git a/doc/m4.texinfo b/doc/m4.texinfo
index 5d3f36bf..eb74de10 100644
--- a/doc/m4.texinfo
+++ b/doc/m4.texinfo
@@ -25,7 +25,8 @@ END-INFO-DIR-ENTRY
@ifinfo
This file documents the GNU @code{m4} utility.
-Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004 Free Software
+Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
@@ -279,7 +280,7 @@ popularity of GNU Autoconf, which prerequires GNU @code{m4} for
for many to install it, while these people will not themselves
program in @code{m4}. GNU @code{m4} is mostly compatible with the
System V, Release 3 version, except for some minor differences.
-@xref{Compatibility} for more details.
+@xref{Compatibility}, for more details.
Some people found @code{m4} to be fairly addictive. They first use
@code{m4} for simple problems, then take bigger and bigger challenges,
@@ -349,24 +350,24 @@ issued, considering all of them to be fatal.
@itemx --debug=@var{flags}
Set the debug-level according to the flags @var{flags}. The debug-level
controls the format and amount of information presented by the debugging
-functions. @xref{Debug Levels} for more details on the format and
+functions. @xref{Debug Levels}, for more details on the format and
meaning of @var{flags}.
@item -l@var{num}
@itemx --arglength=@var{num}
Restrict the size of the output generated by macro tracing. @xref{Debug
-Levels} for more details.
+Levels}, for more details.
@item -o@var{file}
@itemx --error-output=@var{file}
Redirect debug and trace output to the named file. Error messages are
-still printed on the standard error output. @xref{Debug Output} for
+still printed on the standard error output. @xref{Debug Output}, for
more details.
@item -I@var{dir}
@itemx --include=@var{dir}
Make @code{m4} search @var{dir} for included files that are not found in
-the current working directory. @xref{Search Path} for more details.
+the current working directory. @xref{Search Path}, for more details.
@item -e
@itemx --interactive
@@ -630,7 +631,7 @@ is the string
@end example
The quote characters can be changed at any time, using the builtin macro
-@code{changequote}. @xref{Changequote} for more information.
+@code{changequote}. @xref{Changequote}, for more information.
@node Other tokens, Comments, Quoted strings, Syntax
@section Other tokens
@@ -652,7 +653,7 @@ the comment. The commenting effect of the begin comment character
can be inhibited by quoting it.
The comment delimiters can be changed to any string at any time, using
-the builtin macro @code{changecom}. @xref{Changecom} for more
+the builtin macro @code{changecom}. @xref{Changecom}, for more
information.
@c FIXME: more examples would be useful here --ADR
@@ -738,7 +739,7 @@ one has to write @code{m4_dnl} and even @code{m4_m4exit}.
If your version of GNU @code{m4} has the @code{changeword} feature
compiled in, there it offers far more flexibility in specifying the
-syntax of macro names, both builtin or user-defined. @xref{Changeword}
+syntax of macro names, both builtin or user-defined. @xref{Changeword},
for more information on this experimental feature.
Of course, the simplest way to prevent a name to be interpreted
@@ -1571,7 +1572,7 @@ dumpdef(`define')
The last example shows how builtin macros definitions are displayed.
-@xref{Debug Levels} for information on controlling the details of the
+@xref{Debug Levels}, for information on controlling the details of the
display.
@node Trace, Debug Levels, Dumpdef, Debugging
@@ -1622,7 +1623,7 @@ The number between dashes is the depth of the expansion. It is one most
of the time, signifying an expansion at the outermost level, but it
increases when macro arguments contain unquoted macro calls.
-@xref{Debug Levels} for information on controlling the details of the
+@xref{Debug Levels}, for information on controlling the details of the
display.
@node Debug Levels, Debug Output, Trace, Debugging
@@ -2886,7 +2887,7 @@ which executes @var{shell-command} as a shell command.
The expansion of @code{syscmd} is void, @emph{not} the output from
@var{shell-command}! Output or error messages from @var{shell-command}
-are not read by @code{m4}. @xref{Esyscmd} if you need to process the
+are not read by @code{m4}. @xref{Esyscmd}, if you need to process the
command output.
Prior to executing the command, @code{m4} flushes its output buffers.
@@ -2980,7 +2981,7 @@ maketemp(@var{template})
@end example
@noindent
-which expands to a name of a non-existent file, made from the string
+which expands to a name of a new, empty file, made from the string
@var{template}, which should end with the string @samp{XXXXXX}. The six
@code{X}'s are then replaced, usually with something that includes the
process id of the @code{m4} process, in order to make the filename unique.
@@ -2989,15 +2990,8 @@ process id of the @code{m4} process, in order to make the filename unique.
@example
maketemp(`/tmp/fooXXXXXX')
@result{}/tmp/fooa07346
-maketemp(`/tmp/fooXXXXXX')
-@result{}/tmp/fooa07346
@end example
-As seen in the example, several calls of @code{maketemp} might expand to
-the same string, since the selection criteria is whether the file exists
-or not. If a file has not been created before the next call, the two
-macro calls might expand to the same name.
-
The builtin macro @code{maketemp} is recognized only when given
arguments.
diff --git a/doc/stamp-vti b/doc/stamp-vti
index 61e47e5d..9c3260be 100644
--- a/doc/stamp-vti
+++ b/doc/stamp-vti
@@ -1 +1 @@
-Sat Nov 5 22:46:26 EST 1994
+Thu Jun 3 14:51:32 PDT 2004
diff --git a/doc/texinfo.tex b/doc/texinfo.tex
index 245aa14f..ed6446df 100644
--- a/doc/texinfo.tex
+++ b/doc/texinfo.tex
@@ -24,7 +24,7 @@
% This automatically updates the version number based on RCS.
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
-\deftexinfoversion$Revision: 1.1.1.1 $
+\deftexinfoversion$Revision: 1.1.1.1.2.1 $
\message{Loading texinfo package [Version \texinfoversion]:}
% Print the version number if in a .fmt file.
diff --git a/doc/version.texi b/doc/version.texi
index b55168ee..f210529b 100644
--- a/doc/version.texi
+++ b/doc/version.texi
@@ -1,3 +1,3 @@
-@set EDITION 1.4
-@set UPDATED November 1994
-@set VERSION 1.4
+@set EDITION 1.4.1
+@set UPDATED June 2004
+@set VERSION 1.4.1
diff --git a/examples/stackovf.sh b/examples/stackovf.sh
index e389a210..8916afc3 100644
--- a/examples/stackovf.sh
+++ b/examples/stackovf.sh
@@ -21,7 +21,7 @@ PATH=.:..:$PATH; export PATH;
M4=m4
type $M4
-tmpfile=/tmp/t.$$
+tmpfile=`tempfile 2> /dev/null` || tmpfile=/tmp/t.$$
trap 'rm -f $tmpfile; exit 1' 1 2 3 15
rm -f core
diff --git a/src/builtin.c b/src/builtin.c
index 47506018..bc614e55 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -1,5 +1,7 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
+
+ Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2000 Free
+ Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -1076,9 +1078,15 @@ m4_sinclude (struct obstack *obs, int argc, token_data **argv)
static void
m4_maketemp (struct obstack *obs, int argc, token_data **argv)
{
+ int fd;
if (bad_argc (argv[0], argc, 2, 2))
return;
- mktemp (ARG (1));
+ if ((fd = mkstemp (ARG (1))) < 0)
+ {
+ M4ERROR ((warning_status, errno, "Cannot create tempfile %s", ARG (1)));
+ return;
+ }
+ close(fd);
obstack_grow (obs, ARG (1), strlen (ARG (1)));
}
@@ -1380,7 +1388,11 @@ expand_ranges (const char *s, struct obstack *obs)
{
to = *++s;
if (to == '\0')
- obstack_1grow (obs, '-'); /* trailing dash */
+ {
+ /* trailing dash */
+ obstack_1grow (obs, '-');
+ break;
+ }
else if (from <= to)
{
while (from++ < to)
diff --git a/src/debug.c b/src/debug.c
index ad1988d1..e36e0fdf 100644
--- a/src/debug.c
+++ b/src/debug.c
@@ -1,5 +1,5 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1991, 1992, 1993, 1994 Free Software Foundation, Inc.
+ Copyright (C) 1991, 1992, 1993, 1994, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
#include <sys/stat.h>
-#if __STDC__
+#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
@@ -220,7 +220,7 @@ debug_message_prefix (void)
| left quote) and %r (optional right quote). |
`---------------------------------------------------------------------*/
-#if __STDC__
+#ifdef __STDC__
static void
trace_format (const char *fmt, ...)
#else
@@ -228,7 +228,7 @@ static void
trace_format (...)
#endif
{
-#if ! __STDC__
+#ifndef __STDC__
const char *fmt;
#endif
va_list args;
@@ -240,7 +240,7 @@ trace_format (...)
int slen;
int maxlen;
-#if __STDC__
+#ifdef __STDC__
va_start (args, fmt);
#else
va_start (args);
diff --git a/src/m4.c b/src/m4.c
index cdb1b74c..0d7c8a0c 100644
--- a/src/m4.c
+++ b/src/m4.c
@@ -369,7 +369,7 @@ main (int argc, char *const *argv, char *const *envp)
case 'o':
if (!debug_set_output (optarg))
- error (0, errno, optarg);
+ error (0, errno, "%s", optarg);
break;
case 's':
@@ -466,7 +466,7 @@ main (int argc, char *const *argv, char *const *envp)
fp = path_search (argv[optind]);
if (fp == NULL)
{
- error (0, errno, argv[optind]);
+ error (0, errno, "%s", argv[optind]);
continue;
}
else
diff --git a/src/m4.h b/src/m4.h
index feb37573..92d47548 100644
--- a/src/m4.h
+++ b/src/m4.h
@@ -1,5 +1,7 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
+
+ Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2004 Free
+ Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -26,7 +28,7 @@
#include <sys/types.h>
-#if __STDC__
+#ifdef __STDC__
# define voidstar void *
#else
# define voidstar char *
diff --git a/src/output.c b/src/output.c
index fdf8795b..ded99a32 100644
--- a/src/output.c
+++ b/src/output.c
@@ -467,12 +467,12 @@ insert_file (FILE *file)
/* Insert output by big chunks. */
- while (length = read (fileno (file), buffer, COPY_BUFFER_SIZE),
+ errno = 0;
+ while (length = fread (buffer, 1, COPY_BUFFER_SIZE, file),
length != 0)
- if (length == (size_t) -1)
- M4ERROR ((EXIT_FAILURE, errno, "ERROR: Reading inserted file"));
- else
- output_text (buffer, length);
+ output_text (buffer, length);
+ if (errno)
+ M4ERROR ((EXIT_FAILURE, errno, "ERROR: Reading inserted file"));
}
/*-------------------------------------------------------------------------.
diff --git a/src/symtab.c b/src/symtab.c
index 150a84bf..eb8113ef 100644
--- a/src/symtab.c
+++ b/src/symtab.c
@@ -1,6 +1,8 @@
/* GNU m4 -- A simple macro processor
- Copyright (C) 1989, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
-
+
+ Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 2003 Free
+ Software Foundation, Inc.
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
@@ -147,6 +149,9 @@ lookup_symbol (const char *name, symbol_lookup mode)
SYMBOL_TYPE (sym) = TOKEN_VOID;
SYMBOL_TRACED (sym) = SYMBOL_SHADOWED (sym) = FALSE;
SYMBOL_NAME (sym) = xstrdup (name);
+ SYMBOL_SHADOWED (sym) = FALSE;
+ SYMBOL_MACRO_ARGS (sym) = FALSE;
+ SYMBOL_BLIND_NO_ARGS (sym) = FALSE;
SYMBOL_NEXT (sym) = *spp;
(*spp) = sym;
diff --git a/stamp-h.in b/stamp-h.in
index aa5b9250..b7924646 100644
--- a/stamp-h.in
+++ b/stamp-h.in
@@ -1 +1 @@
-Sat Nov 5 22:45:51 EST 1994
+Thu Jun 3 14:51:31 PDT 2004