]> git.pld-linux.org Git - packages/dash.git/blame - dash-debian.patch
- new
[packages/dash.git] / dash-debian.patch
CommitLineData
87dbe793
AM
1From c5ac5b73ace64323a75423e7c1b7b2a0be71a156 Mon Sep 17 00:00:00 2001
2From: Herbert Xu <herbert@gondor.apana.org.au>
3Date: Sat, 22 Sep 2007 20:49:42 +0800
4Subject: [PATCH] [SHELL] Restore foreground process group on exit
5
6On Thu, Jun 07, 2007 at 12:20:27PM +0200, Denis Vlasenko wrote:
7>
8> When I start dash under Midnight Commander and then type 'exit', dash
9> exits all right, but then MC is sent to background. It happens because
10> dash does not restore current process group on exit.
11>
12> Attached patch fixes this. It also fixes another bug: setjobctl(0)
13> must ignore tcsetpgrp errors, because there are cases when tty is
14> destroyed under dash.
15>
16> Patch is run-tested.
17
18I've fixed this slightly differently so that we don't need the
19xtcsetpgrp change.
20---
21 ChangeLog | 4 ++++
22 src/trap.c | 8 +++++++-
23 2 files changed, 11 insertions(+), 1 deletions(-)
24
25diff --git a/ChangeLog b/ChangeLog
26index 6ce16c6..295fa66 100644
27--- a/ChangeLog
28+++ b/ChangeLog
29@@ -1,3 +1,7 @@
30+2007-09-21 Denis Vlasenko <vda.linux@googlemail.com>
31+
32+ * Restore foreground process group on exit.
33+
34 2007-07-12 Herbert Xu <herbert@gondor.apana.org.au>
35
36 * Release 0.5.4.
37diff --git a/src/trap.c b/src/trap.c
38index eae6186..c386db7 100644
39--- a/src/trap.c
40+++ b/src/trap.c
41@@ -357,7 +357,7 @@ exitshell(void)
42 TRACE(("pid %d, exitshell(%d)\n", getpid(), status));
43 if (setjmp(loc.loc)) {
44 if (exception == EXEXIT)
45- _exit(exitstatus);
46+ status = exitstatus;
47 goto out;
48 }
49 handler = &loc;
50@@ -367,6 +367,12 @@ exitshell(void)
51 }
52 flushall();
53 out:
54+ /*
55+ * Disable job control so that whoever had the foreground before we
56+ * started can get it back.
57+ */
58+ if (likely(!setjmp(loc.loc)))
59+ setjobctl(0);
60 _exit(status);
61 /* NOTREACHED */
62 }
63--
641.5.5
65
66From 553f85288bb1cdacfa482f351af26cc924ccb386 Mon Sep 17 00:00:00 2001
67From: Herbert Xu <herbert@gondor.apana.org.au>
68Date: Sat, 22 Sep 2007 20:50:21 +0800
69Subject: [PATCH] [SHELL] Move flushall to the point just before _exit
70
71We need to flush at the very end in case we've generated any errors
72before that. The flushall call cannot perform a longjmp so it's
73safe there.
74---
75 ChangeLog | 4 ++++
76 src/trap.c | 2 +-
77 2 files changed, 5 insertions(+), 1 deletions(-)
78
79diff --git a/ChangeLog b/ChangeLog
80index 295fa66..ba974ca 100644
81--- a/ChangeLog
82+++ b/ChangeLog
83@@ -1,3 +1,7 @@
84+2007-09-22 Herbert Xu <herbert@gondor.apana.org.au>
85+
86+ * Move flushall to the point just before _exit.
87+
88 2007-09-21 Denis Vlasenko <vda.linux@googlemail.com>
89
90 * Restore foreground process group on exit.
91diff --git a/src/trap.c b/src/trap.c
92index c386db7..58cd0cc 100644
93--- a/src/trap.c
94+++ b/src/trap.c
95@@ -365,7 +365,6 @@ exitshell(void)
96 trap[0] = NULL;
97 evalstring(p, 0);
98 }
99- flushall();
100 out:
101 /*
102 * Disable job control so that whoever had the foreground before we
103@@ -373,6 +372,7 @@ out:
104 */
105 if (likely(!setjmp(loc.loc)))
106 setjobctl(0);
107+ flushall();
108 _exit(status);
109 /* NOTREACHED */
110 }
111--
1121.5.5
113
114From cd8b7aebb095f82a574b2863bd82f3333d215042 Mon Sep 17 00:00:00 2001
115From: Oleg Verych <olecom@flower.upol.cz>
116Date: Sat, 22 Sep 2007 21:08:32 +0800
117Subject: [PATCH] [BUILTIN] test: White space fixes
118
119Some trailing whitespace was killed or tabified.
120---
121 ChangeLog | 4 ++++
122 src/bltin/test.c | 14 +++++++-------
123 2 files changed, 11 insertions(+), 7 deletions(-)
124
125diff --git a/ChangeLog b/ChangeLog
126index ba974ca..5804248 100644
127--- a/ChangeLog
128+++ b/ChangeLog
129@@ -1,3 +1,7 @@
130+2007-09-22 Oleg Verych <olecom@flower.upol.cz>
131+
132+ * White space fixes for test(1).
133+
134 2007-09-22 Herbert Xu <herbert@gondor.apana.org.au>
135
136 * Move flushall to the point just before _exit.
137diff --git a/src/bltin/test.c b/src/bltin/test.c
138index f16c819..fd24fae 100644
139--- a/src/bltin/test.c
140+++ b/src/bltin/test.c
141@@ -250,7 +250,7 @@ primary(enum token n)
142
143 if (t_lex(t_wp[1]), t_wp_op && t_wp_op->op_type == BINOP) {
144 return binop();
145- }
146+ }
147
148 return strlen(*t_wp) > 0;
149 }
150@@ -267,7 +267,7 @@ binop(void)
151
152 if ((opnd2 = *++t_wp) == (char *)0)
153 syntax(op->op_text, "argument expected");
154-
155+
156 switch (op->op_num) {
157 default:
158 #ifdef DEBUG
159@@ -389,8 +389,8 @@ isoperand(void)
160 return 0;
161 while (op->op_text) {
162 if (strcmp(s, op->op_text) == 0)
163- return op->op_type == BINOP &&
164- (t[0] != ')' || t[1] != '\0');
165+ return op->op_type == BINOP &&
166+ (t[0] != ')' || t[1] != '\0');
167 op++;
168 }
169 return 0;
170@@ -407,13 +407,13 @@ getn(const char *s)
171 r = strtol(s, &p, 10);
172
173 if (errno != 0)
174- error("%s: out of range", s);
175+ error("%s: out of range", s);
176
177 while (isspace((unsigned char)*p))
178 p++;
179-
180+
181 if (*p)
182- error("%s: bad number", s);
183+ error("%s: bad number", s);
184
185 return (int) r;
186 }
187--
1881.5.5
189
190From cd212af1d362b0466f1f2767252424446c0fbaa5 Mon Sep 17 00:00:00 2001
191From: Oleg Verych <olecom@flower.upol.cz>
192Date: Sat, 22 Sep 2007 21:19:37 +0800
193Subject: [PATCH] [BUILTIN] test: little size and speed optimizations
194
195* Speed up (libc=glibc):
196
197deen:debian/src/dash-0.5.3# echo $(((7853+8631+7529+9777+9161+7552)/6))
1988417,8250 # this patch
199deen:/mnt/work/debian/src/dash-0.5.3# echo $(((9553+7789+9450+9925+7595+9590)/6))
2008983 # short
201deen:debian/src/dash-0.5.3# echo $(( (9655+7853+9733+7826+9618+10053)/6 ))
2029123 # '[' ']'
203deen:debian/src/dash-0.5.3#
204
205deen:debian/src/dash-0.5.3# echo $(((9231+9423+9365+9650+8883+8291)/6))
2069140 # unpatched
207deen:debian/src/dash-0.5.3#
208
209* Size down:
210
211olecom@deen:/mnt/debian/src/dash-0.5.3$ size src/test.o # this patchset
212 text data bss dec hex filename
213 4142 0 16 4158 103e src/test.o
214
215olecom@deen:/mnt/debian/src/dash-0.5.3$ size src/test.o
216 text data bss dec hex filename
217 4209 0 16 4225 1081 src/test.o
218olecom@deen:/mnt/debian/src/dash-0.5.3$
219---
220 ChangeLog | 1 +
221 src/bltin/test.c | 4 ++--
222 2 files changed, 3 insertions(+), 2 deletions(-)
223
224diff --git a/ChangeLog b/ChangeLog
225index 5804248..b22197f 100644
226--- a/ChangeLog
227+++ b/ChangeLog
228@@ -1,6 +1,7 @@
229 2007-09-22 Oleg Verych <olecom@flower.upol.cz>
230
231 * White space fixes for test(1).
232+ * Use direct comparison instead of strcmp in test(1).
233
234 2007-09-22 Herbert Xu <herbert@gondor.apana.org.au>
235
236diff --git a/src/bltin/test.c b/src/bltin/test.c
237index fd24fae..7d49569 100644
238--- a/src/bltin/test.c
239+++ b/src/bltin/test.c
240@@ -157,8 +157,8 @@ testcmd(int argc, char **argv)
241 {
242 int res;
243
244- if (strcmp(argv[0], "[") == 0) {
245- if (strcmp(argv[--argc], "]"))
246+ if (*argv[0] == '[') {
247+ if (*argv[--argc] != ']')
248 error("missing ]");
249 argv[argc] = NULL;
250 }
251--
2521.5.5
253
254From 9b568fedfdc4ec56e52ded4c3a1a135d24c8d75b Mon Sep 17 00:00:00 2001
255From: Herbert Xu <herbert@gondor.apana.org.au>
256Date: Mon, 24 Sep 2007 16:17:20 +0800
257Subject: [PATCH] [EXPAND] Do not quote back slashes in parameter expansions outside quotes
258
259Test case:
260
261 a=/b/c/*
262 b=\\
263 echo ${a%$b*}
264
265Old result:
266
267 /b/c/*
268
269New result:
270
271 /b/c/
272---
273 ChangeLog | 4 ++++
274 src/expand.c | 5 ++---
275 src/mksyntax.c | 5 +++--
276 src/parser.c | 4 +++-
277 4 files changed, 12 insertions(+), 6 deletions(-)
278
279diff --git a/ChangeLog b/ChangeLog
280index b22197f..dca08d5 100644
281--- a/ChangeLog
282+++ b/ChangeLog
283@@ -1,3 +1,7 @@
284+2007-09-24 Herbert Xu <herbert@gondor.apana.org.au>
285+
286+ * Do not quote back slashes in parameter expansions outside quotes.
287+
288 2007-09-22 Oleg Verych <olecom@flower.upol.cz>
289
290 * White space fixes for test(1).
291diff --git a/src/expand.c b/src/expand.c
292index db67c7c..3956112 100644
293--- a/src/expand.c
294+++ b/src/expand.c
295@@ -895,7 +895,7 @@ memtodest(const char *p, size_t len, const char *syntax, int quotes) {
296 int c = (signed char)*p++;
297 if (c) {
298 if ((quotes & QUOTES_ESC) &&
299- (syntax[c] == CCTL || syntax[c] == CBACK))
300+ (syntax[c] == CCTL || syntax[c] == CDBACK))
301 USTPUTC(CTLESC, q);
302 } else if (!(quotes & QUOTES_KEEPNUL))
303 continue;
304@@ -1671,9 +1671,8 @@ _rmescapes(char *str, int flag)
305 }
306 if (*p == (char)CTLESC) {
307 p++;
308- if (notescaped && inquotes && *p != '/') {
309+ if (notescaped && inquotes)
310 *q++ = '\\';
311- }
312 }
313 notescaped = globbing;
314 copy:
315diff --git a/src/mksyntax.c b/src/mksyntax.c
316index 7a8a9ae..9ecbb45 100644
317--- a/src/mksyntax.c
318+++ b/src/mksyntax.c
319@@ -53,6 +53,7 @@ struct synclass synclass[] = {
320 { "CWORD", "character is nothing special" },
321 { "CNL", "newline character" },
322 { "CBACK", "a backslash character" },
323+ { "CDBACK", "a backslash character in double quotes" },
324 { "CSQUOTE", "single quote" },
325 { "CDQUOTE", "double quote" },
326 { "CENDQUOTE", "a terminating quote" },
327@@ -175,7 +176,7 @@ main(int argc, char **argv)
328 init();
329 fputs("\n/* syntax table used when in double quotes */\n", cfile);
330 add("\n", "CNL");
331- add("\\", "CBACK");
332+ add("\\", "CDBACK");
333 add("\"", "CENDQUOTE");
334 add("`", "CBQUOTE");
335 add("$", "CVAR");
336@@ -193,7 +194,7 @@ main(int argc, char **argv)
337 init();
338 fputs("\n/* syntax table used when in arithmetic */\n", cfile);
339 add("\n", "CNL");
340- add("\\", "CBACK");
341+ add("\\", "CDBACK");
342 add("`", "CBQUOTE");
343 add("$", "CVAR");
344 add("}", "CENDVAR");
345diff --git a/src/parser.c b/src/parser.c
346index 6faff17..279d49e 100644
347--- a/src/parser.c
348+++ b/src/parser.c
349@@ -891,7 +891,9 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs)
350 USTPUTC(CTLESC, out);
351 USTPUTC(c, out);
352 break;
353- case CBACK: /* backslash */
354+ /* backslash */
355+ case CBACK:
356+ case CDBACK:
357 c = pgetc2();
358 if (c == PEOF) {
359 USTPUTC(CTLESC, out);
360--
3611.5.5
362
363From 82c20d9ca645ea33cbc500ad3da3b1c8d430322d Mon Sep 17 00:00:00 2001
364From: Herbert Xu <herbert@gondor.apana.org.au>
365Date: Mon, 24 Sep 2007 16:22:25 +0800
366Subject: [PATCH] [EXPAND] Perform tilde expansion in all parameter expansion words
367
368Previously tilde expansion was not carried out for =?#% expansion words.
369This is contrary to the POSIX specification.
370
371Test case:
372
373 a=~root:~root
374 echo ${a#~root}
375
376Old result:
377
378 /root:/root
379
380New result:
381
382 :/root
383---
384 ChangeLog | 1 +
385 src/expand.c | 3 ++-
386 2 files changed, 3 insertions(+), 1 deletions(-)
387
388diff --git a/ChangeLog b/ChangeLog
389index dca08d5..816f56d 100644
390--- a/ChangeLog
391+++ b/ChangeLog
392@@ -1,6 +1,7 @@
393 2007-09-24 Herbert Xu <herbert@gondor.apana.org.au>
394
395 * Do not quote back slashes in parameter expansions outside quotes.
396+ * Perform tilde expansion in all parameter expansion words.
397
398 2007-09-22 Oleg Verych <olecom@flower.upol.cz>
399
400diff --git a/src/expand.c b/src/expand.c
401index 3956112..1443c14 100644
402--- a/src/expand.c
403+++ b/src/expand.c
404@@ -683,7 +683,8 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varfla
405 char *(*scan)(char *, char *, char *, char *, int , int);
406
407 herefd = -1;
408- argstr(p, subtype != VSASSIGN && subtype != VSQUESTION ? EXP_CASE : 0);
409+ argstr(p, EXP_TILDE | (subtype != VSASSIGN && subtype != VSQUESTION ?
410+ EXP_CASE : 0));
411 STPUTC('\0', expdest);
412 herefd = saveherefd;
413 argbackq = saveargbackq;
414--
4151.5.5
416
417From 08ee0731cd65a502f34718c2ac11c266daeb4c5b Mon Sep 17 00:00:00 2001
418From: Herbert Xu <herbert@gondor.apana.org.au>
419Date: Mon, 24 Sep 2007 21:53:49 +0800
420Subject: [PATCH] [PARSER] Remove superfluous arinest test in CENDQUOTE
421
422If arinest is set then the syntax must be ARISYNTAX. As such CENDQUOTE can
423never occur while arinest is set so we don't need to test for it.
424---
425 ChangeLog | 1 +
426 src/parser.c | 5 ++---
427 2 files changed, 3 insertions(+), 3 deletions(-)
428
429diff --git a/ChangeLog b/ChangeLog
430index 816f56d..0a35741 100644
431--- a/ChangeLog
432+++ b/ChangeLog
433@@ -2,6 +2,7 @@
434
435 * Do not quote back slashes in parameter expansions outside quotes.
436 * Perform tilde expansion in all parameter expansion words.
437+ * Remove superfluous arinest test in CENDQUOTE.
438
439 2007-09-22 Oleg Verych <olecom@flower.upol.cz>
440
441diff --git a/src/parser.c b/src/parser.c
442index 279d49e..26c9046 100644
443--- a/src/parser.c
444+++ b/src/parser.c
445@@ -932,10 +932,9 @@ quotemark:
446 dblquote = 1;
447 goto quotemark;
448 case CENDQUOTE:
449- if (eofmark != NULL && arinest == 0 &&
450- varnest == 0) {
451+ if (eofmark && !varnest)
452 USTPUTC(c, out);
453- } else {
454+ else {
455 if (dqvarnest == 0) {
456 syntax = BASESYNTAX;
457 dblquote = 0;
458--
4591.5.5
460
461From ede60fbf86edd87449585781df10e091ec420a1f Mon Sep 17 00:00:00 2001
462From: Herbert Xu <herbert@gondor.apana.org.au>
463Date: Mon, 24 Sep 2007 21:59:39 +0800
464Subject: [PATCH] [PARSER] Remove superfluous arinest test for dqvarnest
465
466dqvarnest is only used to determine whether CENDQUOTE should terminate the
467double-quote syntax. Since CENDQUOTE can never occur while arinest is set,
468we don't need to take arinest into account for dqvarnest.
469---
470 ChangeLog | 1 +
471 src/parser.c | 3 +--
472 2 files changed, 2 insertions(+), 2 deletions(-)
473
474diff --git a/ChangeLog b/ChangeLog
475index 0a35741..b311ad4 100644
476--- a/ChangeLog
477+++ b/ChangeLog
478@@ -3,6 +3,7 @@
479 * Do not quote back slashes in parameter expansions outside quotes.
480 * Perform tilde expansion in all parameter expansion words.
481 * Remove superfluous arinest test in CENDQUOTE.
482+ * Remove superfluous arinest test for dqvarnest.
483
484 2007-09-22 Oleg Verych <olecom@flower.upol.cz>
485
486diff --git a/src/parser.c b/src/parser.c
487index 26c9046..8fac57a 100644
488--- a/src/parser.c
489+++ b/src/parser.c
490@@ -1232,9 +1232,8 @@ badsub: synerror("Bad substitution");
491 *((char *)stackblock() + typeloc) = subtype | flags;
492 if (subtype != VSNORMAL) {
493 varnest++;
494- if (dblquote || arinest) {
495+ if (dblquote)
496 dqvarnest++;
497- }
498 }
499 }
500 goto parsesub_return;
501--
5021.5.5
503
504From b428e83766c7b9d0cb887f0dd582272c5e85a536 Mon Sep 17 00:00:00 2001
505From: Herbert Xu <herbert@gondor.apana.org.au>
506Date: Mon, 24 Sep 2007 22:11:59 +0800
507Subject: [PATCH] [PARSER] Remove superfluous dblquote settings when ending arith
508
509When an arithmetic expansion terminates and we restore the syntax to the
510previous one, we don't need to set dblquote because we never changed upon
511entering the arithmetic expansion.
512---
513 ChangeLog | 1 +
514 src/parser.c | 4 ----
515 2 files changed, 1 insertions(+), 4 deletions(-)
516
517diff --git a/ChangeLog b/ChangeLog
518index b311ad4..e5987f9 100644
519--- a/ChangeLog
520+++ b/ChangeLog
521@@ -4,6 +4,7 @@
522 * Perform tilde expansion in all parameter expansion words.
523 * Remove superfluous arinest test in CENDQUOTE.
524 * Remove superfluous arinest test for dqvarnest.
525+ * Remove superfluous dblquote settings when ending arith.
526
527 2007-09-22 Oleg Verych <olecom@flower.upol.cz>
528
529diff --git a/src/parser.c b/src/parser.c
530index 8fac57a..791251d 100644
531--- a/src/parser.c
532+++ b/src/parser.c
533@@ -970,10 +970,6 @@ quotemark:
534 if (--arinest == 0) {
535 USTPUTC(CTLENDARI, out);
536 syntax = prevsyntax;
537- if (syntax == DQSYNTAX)
538- dblquote = 1;
539- else
540- dblquote = 0;
541 } else
542 USTPUTC(')', out);
543 } else {
544--
5451.5.5
546
547From f28b0328dda170028c3070c69ef38cdd8d269932 Mon Sep 17 00:00:00 2001
548From: Herbert Xu <herbert@gondor.apana.org.au>
549Date: Mon, 24 Sep 2007 22:28:49 +0800
550Subject: [PATCH] [PARSER] Remove arithmetic expansion collapsing at parse time
551
552Collapsing arithmethc expansion is incorrect when the inner arithmetic
553expansion is a part of a parameter expansion.
554
555Test case:
556
557 unset a
558 echo $((3 + ${a:=$((4 + 5))}))
559 echo $a
560
561Old result:
562
563 (4 + 5)
564
565New result:
566
567 9
568---
569 ChangeLog | 1 +
570 src/parser.c | 22 +++++++---------------
571 2 files changed, 8 insertions(+), 15 deletions(-)
572
573diff --git a/ChangeLog b/ChangeLog
574index e5987f9..7992485 100644
575--- a/ChangeLog
576+++ b/ChangeLog
577@@ -5,6 +5,7 @@
578 * Remove superfluous arinest test in CENDQUOTE.
579 * Remove superfluous arinest test for dqvarnest.
580 * Remove superfluous dblquote settings when ending arith.
581+ * Remove arithmetic expansion collapsing at parse time.
582
583 2007-09-22 Oleg Verych <olecom@flower.upol.cz>
584
585diff --git a/src/parser.c b/src/parser.c
586index 791251d..e00fd4b 100644
587--- a/src/parser.c
588+++ b/src/parser.c
589@@ -967,11 +967,9 @@ quotemark:
590 --parenlevel;
591 } else {
592 if (pgetc() == ')') {
593- if (--arinest == 0) {
594- USTPUTC(CTLENDARI, out);
595+ USTPUTC(CTLENDARI, out);
596+ if (!--arinest)
597 syntax = prevsyntax;
598- } else
599- USTPUTC(')', out);
600 } else {
601 /*
602 * unbalanced parens
603@@ -1373,18 +1371,12 @@ parsearith: {
604 if (++arinest == 1) {
605 prevsyntax = syntax;
606 syntax = ARISYNTAX;
607- USTPUTC(CTLARI, out);
608- if (dblquote)
609- USTPUTC('"',out);
610- else
611- USTPUTC(' ',out);
612- } else {
613- /*
614- * we collapse embedded arithmetic expansion to
615- * parenthesis, which should be equivalent
616- */
617- USTPUTC('(', out);
618 }
619+ USTPUTC(CTLARI, out);
620+ if (dblquote)
621+ USTPUTC('"',out);
622+ else
623+ USTPUTC(' ',out);
624 goto parsearith_return;
625 }
626
627--
6281.5.5
629
630From 7e9ee068665eda9591126d3015badf92d7d593f7 Mon Sep 17 00:00:00 2001
631From: Herbert Xu <herbert@gondor.apana.org.au>
632Date: Tue, 25 Sep 2007 10:54:13 +0800
633Subject: [PATCH] [EXPAND] Do not expand tilde in parameter expansion within quotes
634
635Previously code was added so that tilde expansion was carried out
636parameter expansions within double quotes. This change was made
637with reference the behaviour of bash at the time. Bash has since
638be fixed so that this behaviour no longer occurs which is in line
639with most other POSIX shells.
640
641So this patch removes that behaviour in dash as well.
642
643Test case:
644
645 unset a
646 echo "${a:-~root}"
647
648Old result:
649
650 /root
651
652New result:
653
654 ~root
655---
656 ChangeLog | 4 ++++
657 src/expand.c | 10 +++-------
658 src/expand.h | 2 +-
659 3 files changed, 8 insertions(+), 8 deletions(-)
660
661diff --git a/ChangeLog b/ChangeLog
662index 7992485..dacc9b3 100644
663--- a/ChangeLog
664+++ b/ChangeLog
665@@ -1,3 +1,7 @@
666+2007-09-25 Herbert Xu <herbert@gondor.apana.org.au>
667+
668+ * Do not expand tilde in parameter expansion within quotes.
669+
670 2007-09-24 Herbert Xu <herbert@gondor.apana.org.au>
671
672 * Do not quote back slashes in parameter expansions outside quotes.
673diff --git a/src/expand.c b/src/expand.c
674index 1443c14..c9f09ff 100644
675--- a/src/expand.c
676+++ b/src/expand.c
677@@ -278,7 +278,7 @@ argstr(char *p, int flag)
678 const char *reject = spclchars;
679 int c;
680 int quotes = flag & QUOTES_ESC;
681- int breakall = flag & EXP_WORD;
682+ int breakall = (flag & (EXP_WORD | EXP_QUOTED)) == EXP_WORD;
683 int inquotes;
684 size_t length;
685 int startloc;
686@@ -296,8 +296,6 @@ argstr(char *p, int flag)
687 flag &= ~EXP_TILDE;
688 tilde:
689 q = p;
690- if (*q == (char)CTLESC && (flag & EXP_QWORD))
691- q++;
692 if (*q == '~')
693 p = exptilde(p, q, flag);
694 }
695@@ -780,10 +778,8 @@ again:
696 if (subtype == VSMINUS) {
697 vsplus:
698 if (varlen < 0) {
699- argstr(
700- p, flag | EXP_TILDE |
701- (quoted ? EXP_QWORD : EXP_WORD)
702- );
703+ argstr(p, flag | EXP_TILDE | EXP_WORD |
704+ (quoted ? EXP_QUOTED : 0));
705 goto end;
706 }
707 if (easy)
708diff --git a/src/expand.h b/src/expand.h
709index 6b7d607..be7ec6f 100644
710--- a/src/expand.h
711+++ b/src/expand.h
712@@ -56,7 +56,7 @@ struct arglist {
713 #define EXP_RECORD 0x20 /* need to record arguments for ifs breakup */
714 #define EXP_VARTILDE2 0x40 /* expand tildes after colons only */
715 #define EXP_WORD 0x80 /* expand word in parameter expansion */
716-#define EXP_QWORD 0x100 /* expand word in quoted parameter expansion */
717+#define EXP_QUOTED 0x100 /* expand word in double quotes */
718
719
720 union node;
721--
7221.5.5
723
724From 9ba0b212900e642649b4ad354a00de763bf8303f Mon Sep 17 00:00:00 2001
725From: Herbert Xu <herbert@gondor.apana.org.au>
726Date: Tue, 25 Sep 2007 22:29:00 +0800
727Subject: [PATCH] [EXPAND] Move parse-time quote flag detection to run-time
728
729Because the parser does not recursively parse parameter expansion with respect
730to quotes, we can't accurately determine quote status at parse time. This
731patch works around this by moving the quote detection to run-time where we
732do interpret it recursively.
733
734Test case:
735
736 foo=\\
737 echo "<${foo#[\\]}>"
738
739Old result:
740
741 <\>
742
743New result:
744
745 <>
746---
747 ChangeLog | 1 +
748 src/eval.c | 2 +-
749 src/expand.c | 110 +++++++++++++++++++++++++------------------------------
750 src/expand.h | 2 +-
751 src/jobs.c | 10 +-----
752 src/mystring.c | 3 +-
753 src/mystring.h | 2 +-
754 src/parser.c | 17 ++-------
755 src/parser.h | 3 --
756 src/show.c | 3 --
757 10 files changed, 60 insertions(+), 93 deletions(-)
758
759diff --git a/ChangeLog b/ChangeLog
760index dacc9b3..d5c51bf 100644
761--- a/ChangeLog
762+++ b/ChangeLog
763@@ -1,6 +1,7 @@
764 2007-09-25 Herbert Xu <herbert@gondor.apana.org.au>
765
766 * Do not expand tilde in parameter expansion within quotes.
767+ * Move parse-time quote flag detection to run-time.
768
769 2007-09-24 Herbert Xu <herbert@gondor.apana.org.au>
770
771diff --git a/src/eval.c b/src/eval.c
772index fed82d5..2aa8317 100644
773--- a/src/eval.c
774+++ b/src/eval.c
775@@ -377,7 +377,7 @@ evalfor(union node *n, int flags)
776 setstackmark(&smark);
777 arglist.lastp = &arglist.list;
778 for (argp = n->nfor.args ; argp ; argp = argp->narg.next) {
779- expandarg(argp, &arglist, EXP_FULL | EXP_TILDE | EXP_RECORD);
780+ expandarg(argp, &arglist, EXP_FULL | EXP_TILDE);
781 /* XXX */
782 if (evalskip)
783 goto out;
784diff --git a/src/expand.c b/src/expand.c
785index c9f09ff..8c6c7f9 100644
786--- a/src/expand.c
787+++ b/src/expand.c
788@@ -82,12 +82,11 @@
789 */
790 #define RMESCAPE_ALLOC 0x1 /* Allocate a new string */
791 #define RMESCAPE_GLOB 0x2 /* Add backslashes for glob */
792-#define RMESCAPE_QUOTED 0x4 /* Remove CTLESC unless in quotes */
793 #define RMESCAPE_GROW 0x8 /* Grow strings instead of stalloc */
794 #define RMESCAPE_HEAP 0x10 /* Malloc strings instead of stalloc */
795
796 /* Add CTLESC when necessary. */
797-#define QUOTES_ESC (EXP_FULL | EXP_CASE)
798+#define QUOTES_ESC (EXP_FULL | EXP_CASE | EXP_QPAT)
799 /* Do not skip NUL characters. */
800 #define QUOTES_KEEPNUL EXP_TILDE
801
802@@ -116,7 +115,7 @@ static struct arglist exparg;
803
804 STATIC void argstr(char *, int);
805 STATIC char *exptilde(char *, char *, int);
806-STATIC void expbackq(union node *, int, int);
807+STATIC void expbackq(union node *, int);
808 STATIC const char *subevalvar(char *, char *, int, int, int, int, int);
809 STATIC char *evalvar(char *, int);
810 STATIC size_t strtodest(const char *, const char *, int);
811@@ -158,11 +157,8 @@ STATIC void varunset(const char *, const char *, const char *, int)
812 */
813
814 STATIC inline char *
815-preglob(const char *pattern, int quoted, int flag) {
816+preglob(const char *pattern, int flag) {
817 flag |= RMESCAPE_GLOB;
818- if (quoted) {
819- flag |= RMESCAPE_QUOTED;
820- }
821 return _rmescapes((char *)pattern, flag);
822 }
823
824@@ -197,7 +193,7 @@ void
825 expandhere(union node *arg, int fd)
826 {
827 herefd = fd;
828- expandarg(arg, (struct arglist *)NULL, 0);
829+ expandarg(arg, (struct arglist *)NULL, EXP_QUOTED);
830 xwrite(fd, stackblock(), expdest - (char *)stackblock());
831 }
832
833@@ -271,13 +267,11 @@ argstr(char *p, int flag)
834 CTLESC,
835 CTLVAR,
836 CTLBACKQ,
837- CTLBACKQ | CTLQUOTE,
838 CTLENDARI,
839 0
840 };
841 const char *reject = spclchars;
842 int c;
843- int quotes = flag & QUOTES_ESC;
844 int breakall = (flag & (EXP_WORD | EXP_QUOTED)) == EXP_WORD;
845 int inquotes;
846 size_t length;
847@@ -346,21 +340,15 @@ start:
848 case CTLENDVAR: /* ??? */
849 goto breakloop;
850 case CTLQUOTEMARK:
851+ inquotes ^= EXP_QUOTED;
852 /* "$@" syntax adherence hack */
853- if (
854- !inquotes &&
855- !memcmp(p, dolatstr, DOLATSTRLEN) &&
856- (p[4] == (char)CTLQUOTEMARK || (
857- p[4] == (char)CTLENDVAR &&
858- p[5] == (char)CTLQUOTEMARK
859- ))
860- ) {
861- p = evalvar(p + 1, flag) + 1;
862+ if (inquotes && !memcmp(p, dolatstr + 1,
863+ DOLATSTRLEN - 1)) {
864+ p = evalvar(p + 1, flag | inquotes) + 1;
865 goto start;
866 }
867- inquotes = !inquotes;
868 addquote:
869- if (quotes) {
870+ if (flag & QUOTES_ESC) {
871 p--;
872 length++;
873 startloc++;
874@@ -369,19 +357,27 @@ addquote:
875 case CTLESC:
876 startloc++;
877 length++;
878+
879+ /*
880+ * Quoted parameter expansion pattern: remove quote
881+ * unless inside inner quotes or we have a literal
882+ * backslash.
883+ */
884+ if (((flag | inquotes) & (EXP_QPAT | EXP_QUOTED)) ==
885+ EXP_QPAT && *p != '\\')
886+ break;
887+
888 goto addquote;
889 case CTLVAR:
890- p = evalvar(p, flag);
891+ p = evalvar(p, flag | inquotes);
892 goto start;
893 case CTLBACKQ:
894- c = 0;
895- case CTLBACKQ|CTLQUOTE:
896- expbackq(argbackq->n, c, quotes);
897+ expbackq(argbackq->n, flag | inquotes);
898 argbackq = argbackq->next;
899 goto start;
900 case CTLENDARI:
901 p--;
902- expari(quotes);
903+ expari(flag | inquotes);
904 goto start;
905 }
906 }
907@@ -480,11 +476,10 @@ removerecordregions(int endoff)
908 * evaluate, place result in (backed up) result, adjust string position.
909 */
910 void
911-expari(int quotes)
912+expari(int flag)
913 {
914 char *p, *start;
915 int begoff;
916- int flag;
917 int len;
918
919 /* ifsfree(); */
920@@ -522,16 +517,14 @@ expari(int quotes)
921
922 removerecordregions(begoff);
923
924- flag = p[1];
925-
926 expdest = p;
927
928- if (quotes)
929- rmescapes(p + 2);
930+ if (flag & QUOTES_ESC)
931+ rmescapes(p + 1);
932
933- len = cvtnum(arith(p + 2));
934+ len = cvtnum(arith(p + 1));
935
936- if (flag != '"')
937+ if (!(flag & EXP_QUOTED))
938 recordregion(begoff, begoff + len, 0);
939 }
940
941@@ -541,7 +534,7 @@ expari(int quotes)
942 */
943
944 STATIC void
945-expbackq(union node *cmd, int quoted, int quotes)
946+expbackq(union node *cmd, int flag)
947 {
948 struct backcmd in;
949 int i;
950@@ -549,7 +542,7 @@ expbackq(union node *cmd, int quoted, int quotes)
951 char *p;
952 char *dest;
953 int startloc;
954- char const *syntax = quoted? DQSYNTAX : BASESYNTAX;
955+ char const *syntax = flag & EXP_QUOTED ? DQSYNTAX : BASESYNTAX;
956 struct stackmark smark;
957
958 INTOFF;
959@@ -565,7 +558,7 @@ expbackq(union node *cmd, int quoted, int quotes)
960 if (i == 0)
961 goto read;
962 for (;;) {
963- memtodest(p, i, syntax, quotes);
964+ memtodest(p, i, syntax, flag & QUOTES_ESC);
965 read:
966 if (in.fd < 0)
967 break;
968@@ -592,7 +585,7 @@ read:
969 STUNPUTC(dest);
970 expdest = dest;
971
972- if (quoted == 0)
973+ if (!(flag & EXP_QUOTED))
974 recordregion(startloc, dest - (char *)stackblock(), 0);
975 TRACE(("evalbackq: size=%d: \"%.*s\"\n",
976 (dest - (char *)stackblock()) - startloc,
977@@ -669,8 +662,9 @@ scanright(
978 }
979
980 STATIC const char *
981-subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varflags, int quotes)
982+subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varflags, int flag)
983 {
984+ int quotes = flag & QUOTES_ESC;
985 char *startp;
986 char *loc;
987 int saveherefd = herefd;
988@@ -682,7 +676,7 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varfla
989
990 herefd = -1;
991 argstr(p, EXP_TILDE | (subtype != VSASSIGN && subtype != VSQUESTION ?
992- EXP_CASE : 0));
993+ (flag & EXP_QUOTED ? EXP_QPAT : EXP_CASE) : 0));
994 STPUTC('\0', expdest);
995 herefd = saveherefd;
996 argbackq = saveargbackq;
997@@ -717,7 +711,7 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varfla
998 }
999 rmescend--;
1000 str = stackblock() + strloc;
1001- preglob(str, varflags & VSQUOTE, 0);
1002+ preglob(str, 0);
1003
1004 /* zero = subtype == VSTRIMLEFT || subtype == VSTRIMLEFTMAX */
1005 zero = subtype >> 1;
1006@@ -753,13 +747,11 @@ evalvar(char *p, int flag)
1007 int startloc;
1008 ssize_t varlen;
1009 int easy;
1010- int quotes;
1011 int quoted;
1012
1013- quotes = flag & QUOTES_ESC;
1014 varflags = *p++;
1015 subtype = varflags & VSTYPE;
1016- quoted = varflags & VSQUOTE;
1017+ quoted = flag & EXP_QUOTED;
1018 var = p;
1019 easy = (!quoted || (*var == '@' && shellparam.nparam));
1020 startloc = expdest - (char *)stackblock();
1021@@ -778,8 +770,7 @@ again:
1022 if (subtype == VSMINUS) {
1023 vsplus:
1024 if (varlen < 0) {
1025- argstr(p, flag | EXP_TILDE | EXP_WORD |
1026- (quoted ? EXP_QUOTED : 0));
1027+ argstr(p, flag | EXP_TILDE | EXP_WORD);
1028 goto end;
1029 }
1030 if (easy)
1031@@ -790,7 +781,7 @@ vsplus:
1032 if (subtype == VSASSIGN || subtype == VSQUESTION) {
1033 if (varlen < 0) {
1034 if (subevalvar(p, var, 0, subtype, startloc,
1035- varflags, 0)) {
1036+ varflags, flag & ~QUOTES_ESC)) {
1037 varflags &= ~VSNUL;
1038 /*
1039 * Remove any recorded regions beyond
1040@@ -842,7 +833,7 @@ record:
1041 STPUTC('\0', expdest);
1042 patloc = expdest - (char *)stackblock();
1043 if (subevalvar(p, NULL, patloc, subtype,
1044- startloc, varflags, quotes) == 0) {
1045+ startloc, varflags, flag) == 0) {
1046 int amount = expdest - (
1047 (char *)stackblock() + patloc - 1
1048 );
1049@@ -859,7 +850,7 @@ end:
1050 for (;;) {
1051 if ((c = (signed char)*p++) == CTLESC)
1052 p++;
1053- else if (c == CTLBACKQ || c == (CTLBACKQ|CTLQUOTE)) {
1054+ else if (c == CTLBACKQ) {
1055 if (varlen >= 0)
1056 argbackq = argbackq->next;
1057 } else if (c == CTLVAR) {
1058@@ -930,7 +921,7 @@ varvalue(char *name, int varflags, int flags)
1059 char sepc;
1060 char **ap;
1061 char const *syntax;
1062- int quoted = varflags & VSQUOTE;
1063+ int quoted = flags & EXP_QUOTED;
1064 int subtype = varflags & VSTYPE;
1065 int discard = subtype == VSPLUS || subtype == VSLENGTH;
1066 int quotes = (discard ? 0 : (flags & QUOTES_ESC)) | QUOTES_KEEPNUL;
1067@@ -1175,7 +1166,7 @@ expandmeta(str, flag)
1068 if (fflag)
1069 goto nometa;
1070 INTOFF;
1071- p = preglob(str->text, 0, RMESCAPE_ALLOC | RMESCAPE_HEAP);
1072+ p = preglob(str->text, RMESCAPE_ALLOC | RMESCAPE_HEAP);
1073 i = glob(p, GLOB_NOMAGIC, 0, &pglob);
1074 if (p != str->text)
1075 ckfree(p);
1076@@ -1244,7 +1235,7 @@ expandmeta(struct strlist *str, int flag)
1077 savelastp = exparg.lastp;
1078
1079 INTOFF;
1080- p = preglob(str->text, 0, RMESCAPE_ALLOC | RMESCAPE_HEAP);
1081+ p = preglob(str->text, RMESCAPE_ALLOC | RMESCAPE_HEAP);
1082 {
1083 int i = strlen(str->text);
1084 expdir = ckmalloc(i < 2048 ? 2048 : i); /* XXX */
1085@@ -1475,7 +1466,7 @@ msort(struct strlist *list, int len)
1086 STATIC inline int
1087 patmatch(char *pattern, const char *string)
1088 {
1089- return pmatch(preglob(pattern, 0, 0), string);
1090+ return pmatch(preglob(pattern, 0), string);
1091 }
1092
1093
1094@@ -1651,7 +1642,7 @@ _rmescapes(char *str, int flag)
1095 q = mempcpy(q, str, len);
1096 }
1097 }
1098- inquotes = (flag & RMESCAPE_QUOTED) ^ RMESCAPE_QUOTED;
1099+ inquotes = 0;
1100 globbing = flag & RMESCAPE_GLOB;
1101 notescaped = globbing;
1102 while (*p) {
1103@@ -1661,15 +1652,14 @@ _rmescapes(char *str, int flag)
1104 notescaped = globbing;
1105 continue;
1106 }
1107- if (*p == '\\') {
1108- /* naked back slash */
1109- notescaped = 0;
1110- goto copy;
1111- }
1112 if (*p == (char)CTLESC) {
1113 p++;
1114- if (notescaped && inquotes)
1115+ if (notescaped)
1116 *q++ = '\\';
1117+ } else if (*p == '\\' && !inquotes) {
1118+ /* naked back slash */
1119+ notescaped = 0;
1120+ goto copy;
1121 }
1122 notescaped = globbing;
1123 copy:
1124diff --git a/src/expand.h b/src/expand.h
1125index be7ec6f..4dfbc43 100644
1126--- a/src/expand.h
1127+++ b/src/expand.h
1128@@ -53,7 +53,7 @@ struct arglist {
1129 #define EXP_VARTILDE 0x4 /* expand tildes in an assignment */
1130 #define EXP_REDIR 0x8 /* file glob for a redirection (1 match only) */
1131 #define EXP_CASE 0x10 /* keeps quotes around for CASE pattern */
1132-#define EXP_RECORD 0x20 /* need to record arguments for ifs breakup */
1133+#define EXP_QPAT 0x20 /* pattern in quoted parameter expansion */
1134 #define EXP_VARTILDE2 0x40 /* expand tildes after colons only */
1135 #define EXP_WORD 0x80 /* expand word in parameter expansion */
1136 #define EXP_QUOTED 0x100 /* expand word in double quotes */
1137diff --git a/src/jobs.c b/src/jobs.c
1138index 7285d0d..529d615 100644
1139--- a/src/jobs.c
1140+++ b/src/jobs.c
1141@@ -1377,12 +1377,7 @@ cmdputs(const char *s)
1142 str = "${#";
1143 else
1144 str = "${";
1145- if (!(subtype & VSQUOTE) != !(quoted & 1)) {
1146- quoted ^= 1;
1147- c = '"';
1148- } else
1149- goto dostr;
1150- break;
1151+ goto dostr;
1152 case CTLENDVAR:
1153 str = "\"}" + !(quoted & 1);
1154 quoted >>= 1;
1155@@ -1391,9 +1386,6 @@ cmdputs(const char *s)
1156 case CTLBACKQ:
1157 str = "$(...)";
1158 goto dostr;
1159- case CTLBACKQ+CTLQUOTE:
1160- str = "\"$(...)\"";
1161- goto dostr;
1162 case CTLARI:
1163 str = "$((";
1164 goto dostr;
1165diff --git a/src/mystring.c b/src/mystring.c
1166index 49201a9..7d937a8 100644
1167--- a/src/mystring.c
1168+++ b/src/mystring.c
1169@@ -55,7 +55,8 @@
1170 char nullstr[1]; /* zero length string */
1171 const char spcstr[] = " ";
1172 const char snlfmt[] = "%s\n";
1173-const char dolatstr[] = { CTLVAR, VSNORMAL|VSQUOTE, '@', '=', '\0' };
1174+const char dolatstr[] = { CTLQUOTEMARK, CTLVAR, VSNORMAL, '@', '=',
1175+ CTLQUOTEMARK, '\0' };
1176 const char illnum[] = "Illegal number: %s";
1177 const char homestr[] = "HOME";
1178
1179diff --git a/src/mystring.h b/src/mystring.h
1180index 44fd7e4..f451cc2 100644
1181--- a/src/mystring.h
1182+++ b/src/mystring.h
1183@@ -39,7 +39,7 @@
1184 extern const char snlfmt[];
1185 extern const char spcstr[];
1186 extern const char dolatstr[];
1187-#define DOLATSTRLEN 4
1188+#define DOLATSTRLEN 6
1189 extern const char illnum[];
1190 extern const char homestr[];
1191
1192diff --git a/src/parser.c b/src/parser.c
1193index e00fd4b..1a483d4 100644
1194--- a/src/parser.c
1195+++ b/src/parser.c
1196@@ -911,11 +911,9 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs)
1197 eofmark != NULL
1198 )
1199 ) {
1200- USTPUTC(CTLESC, out);
1201 USTPUTC('\\', out);
1202 }
1203- if (SQSYNTAX[c] == CCTL)
1204- USTPUTC(CTLESC, out);
1205+ USTPUTC(CTLESC, out);
1206 USTPUTC(c, out);
1207 quotef++;
1208 }
1209@@ -1221,8 +1219,6 @@ badsub: synerror("Bad substitution");
1210 } else {
1211 pungetc();
1212 }
1213- if (dblquote || arinest)
1214- flags |= VSQUOTE;
1215 *((char *)stackblock() + typeloc) = subtype | flags;
1216 if (subtype != VSNORMAL) {
1217 varnest++;
1218@@ -1353,10 +1349,7 @@ done:
1219 memcpy(out, str, savelen);
1220 STADJUST(savelen, out);
1221 }
1222- if (arinest || dblquote)
1223- USTPUTC(CTLBACKQ | CTLQUOTE, out);
1224- else
1225- USTPUTC(CTLBACKQ, out);
1226+ USTPUTC(CTLBACKQ, out);
1227 if (oldstyle)
1228 goto parsebackq_oldreturn;
1229 else
1230@@ -1373,10 +1366,6 @@ parsearith: {
1231 syntax = ARISYNTAX;
1232 }
1233 USTPUTC(CTLARI, out);
1234- if (dblquote)
1235- USTPUTC('"',out);
1236- else
1237- USTPUTC(' ',out);
1238 goto parsearith_return;
1239 }
1240
1241@@ -1503,7 +1492,7 @@ expandstr(const char *ps)
1242 n.narg.text = wordtext;
1243 n.narg.backquote = backquotelist;
1244
1245- expandarg(&n, NULL, 0);
1246+ expandarg(&n, NULL, EXP_QUOTED);
1247 return stackblock();
1248 }
1249
1250diff --git a/src/parser.h b/src/parser.h
1251index 76ec839..badbd07 100644
1252--- a/src/parser.h
1253+++ b/src/parser.h
1254@@ -40,8 +40,6 @@
1255 #define CTLVAR -126 /* variable defn */
1256 #define CTLENDVAR -125
1257 #define CTLBACKQ -124
1258-#define CTLQUOTE 01 /* ored with CTLBACKQ code if in quotes */
1259-/* CTLBACKQ | CTLQUOTE == -123 */
1260 #define CTLARI -122 /* arithmetic expression */
1261 #define CTLENDARI -121
1262 #define CTLQUOTEMARK -120
1263@@ -50,7 +48,6 @@
1264 /* variable substitution byte (follows CTLVAR) */
1265 #define VSTYPE 0x0f /* type of variable substitution */
1266 #define VSNUL 0x10 /* colon--treat the empty string as unset */
1267-#define VSQUOTE 0x80 /* inside double quotes--suppress splitting */
1268
1269 /* values of VSTYPE field */
1270 #define VSNORMAL 0x1 /* normal variable: $var or ${var} */
1271diff --git a/src/show.c b/src/show.c
1272index 1b58de1..14dbef3 100644
1273--- a/src/show.c
1274+++ b/src/show.c
1275@@ -222,7 +222,6 @@ sharg(union node *arg, FILE *fp)
1276 putc('}', fp);
1277 break;
1278 case CTLBACKQ:
1279- case CTLBACKQ|CTLQUOTE:
1280 putc('$', fp);
1281 putc('(', fp);
1282 shtree(bqlist->n, -1, NULL, fp);
1283@@ -314,9 +313,7 @@ trstring(char *s)
1284 case '\\': c = '\\'; goto backslash;
1285 case CTLESC: c = 'e'; goto backslash;
1286 case CTLVAR: c = 'v'; goto backslash;
1287- case CTLVAR+CTLQUOTE: c = 'V'; goto backslash;
1288 case CTLBACKQ: c = 'q'; goto backslash;
1289- case CTLBACKQ+CTLQUOTE: c = 'Q'; goto backslash;
1290 backslash: putc('\\', tracefile);
1291 putc(c, tracefile);
1292 break;
1293--
12941.5.5
1295
1296From 68cbcb7160c5b02c2184e850ff3d5c52864ba024 Mon Sep 17 00:00:00 2001
1297From: Gerrit Pape <pape@smarden.org>
1298Date: Tue, 25 Sep 2007 22:46:55 +0800
1299Subject: [PATCH] [MAN] Clarify description of -nt, -ot options to test builtin
1300
1301Have the man page explicitely state how the test builtin behaves on
1302-nt and -ot options if file2 does not exist. The case where file1
1303does not exist was already documented properly.
1304
1305This was noticed by Sven Mueller and reported through
1306 http://bugs.debian.org/373611
1307---
1308 ChangeLog | 4 ++++
1309 src/dash.1 | 12 ++++++++++--
1310 2 files changed, 14 insertions(+), 2 deletions(-)
1311
1312diff --git a/ChangeLog b/ChangeLog
1313index d5c51bf..4ea7374 100644
1314--- a/ChangeLog
1315+++ b/ChangeLog
1316@@ -1,3 +1,7 @@
1317+2007-09-25 Gerrit Pape <pape@smarden.org>
1318+
1319+ * Clarify description of -nt, -ot options to test builtin.
1320+
1321 2007-09-25 Herbert Xu <herbert@gondor.apana.org.au>
1322
1323 * Do not expand tilde in parameter expansion within quotes.
1324diff --git a/src/dash.1 b/src/dash.1
1325index 00f40bd..3aefe21 100644
1326--- a/src/dash.1
1327+++ b/src/dash.1
1328@@ -1934,12 +1934,20 @@ exists and is a socket.
1329 .It Ar file1 Fl nt Ar file2
1330 True if
1331 .Ar file1
1332-exists and is newer than
1333+and
1334+.Ar file2
1335+exist and
1336+.Ar file1
1337+is newer than
1338 .Ar file2 .
1339 .It Ar file1 Fl ot Ar file2
1340 True if
1341 .Ar file1
1342-exists and is older than
1343+and
1344+.Ar file2
1345+exist and
1346+.Ar file1
1347+is older than
1348 .Ar file2 .
1349 .It Ar file1 Fl ef Ar file2
1350 True if
1351--
13521.5.5
1353
1354From f6ff75befa660341c839e1fa8c1a33eb61afc4c8 Mon Sep 17 00:00:00 2001
1355From: Gerrit Pape <pape@smarden.org>
1356Date: Tue, 25 Sep 2007 22:47:25 +0800
1357Subject: [PATCH] [MAN] Clarify syntax of the for command
1358
1359Document that in a for loop 'in word ...' is optional, and if omitted,
1360'in "$@"' is used.
1361
1362Lars Wilke noticed this, and reported through
1363 http://bugs.debian.org/387441
1364---
1365 ChangeLog | 1 +
1366 src/dash.1 | 7 +++++--
1367 2 files changed, 6 insertions(+), 2 deletions(-)
1368
1369diff --git a/ChangeLog b/ChangeLog
1370index 4ea7374..003a0f7 100644
1371--- a/ChangeLog
1372+++ b/ChangeLog
1373@@ -1,6 +1,7 @@
1374 2007-09-25 Gerrit Pape <pape@smarden.org>
1375
1376 * Clarify description of -nt, -ot options to test builtin.
1377+ * Clarify syntax of the for command.
1378
1379 2007-09-25 Herbert Xu <herbert@gondor.apana.org.au>
1380
1381diff --git a/src/dash.1 b/src/dash.1
1382index 3aefe21..9b8ab0e 100644
1383--- a/src/dash.1
1384+++ b/src/dash.1
1385@@ -640,17 +640,20 @@ repeat until the exit status of the first list is zero.
1386 .Pp
1387 The syntax of the for command is
1388 .Bd -literal -offset indent
1389-for variable in word ...
1390+for variable [ in [ word ... ] ]
1391 do list
1392 done
1393 .Ed
1394 .Pp
1395-The words are expanded, and then the list is executed repeatedly with the
1396+The words following
1397+.Pa in
1398+are expanded, and then the list is executed repeatedly with the
1399 variable set to each word in turn.
1400 do and done may be replaced with
1401 .Dq {
1402 and
1403 .Dq } .
1404+Omitting in word ... is equivalent to in "$@".
1405 .Pp
1406 The syntax of the break and continue command is
1407 .Bd -literal -offset indent
1408--
14091.5.5
1410
1411From 2a419c48841ba0ed9fe95b1f95308ed6e174ac4b Mon Sep 17 00:00:00 2001
1412From: Roy Marples <uberlord@gentoo.org>
1413Date: Wed, 26 Sep 2007 13:59:56 +0800
1414Subject: [PATCH] [EXPAND] Refresh stack pointers after makestrspace in _rmescapes
1415
1416dash-0.5.3 has an issue reading some line lengths [1].
1417This is reproducable on amd64, but not on other arches for some reason.
1418
1419$ cat bug.sh
1420(read line; echo "${line%%=*}") <<EOF
1421TITLE=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1422EOF
1423printf "\
1424TITLE=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1425" | (read line; echo "${line%%=*}")
1426$ bash bug.sh
1427TITLE
1428TITLE
1429$ dash bug.sh
1430TITLE=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx+xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
1431TITLE
1432
1433Attahced is a patch to fix the issue
1434
1435Thanks
1436
1437Roy
1438
1439[1] http://bugs.gentoo.org/show_bug.cgi?id=180680
1440---
1441 ChangeLog | 4 ++++
1442 src/expand.c | 4 ++++
1443 2 files changed, 8 insertions(+), 0 deletions(-)
1444
1445diff --git a/ChangeLog b/ChangeLog
1446index 003a0f7..670682b 100644
1447--- a/ChangeLog
1448+++ b/ChangeLog
1449@@ -1,3 +1,7 @@
1450+2007-09-26 Roy Marples <uberlord@gentoo.org>
1451+
1452+ * Refresh stack pointers after makestrspace in _rmescapes.
1453+
1454 2007-09-25 Gerrit Pape <pape@smarden.org>
1455
1456 * Clarify description of -nt, -ot options to test builtin.
1457diff --git a/src/expand.c b/src/expand.c
1458index 8c6c7f9..98ad718 100644
1459--- a/src/expand.c
1460+++ b/src/expand.c
1461@@ -1631,7 +1631,11 @@ _rmescapes(char *str, int flag)
1462 size_t fulllen = len + strlen(p) + 1;
1463
1464 if (flag & RMESCAPE_GROW) {
1465+ int strloc = str - (char *)stackblock();
1466+
1467 r = makestrspace(fulllen, expdest);
1468+ str = (char *)stackblock() + strloc;
1469+ p = str + len;
1470 } else if (flag & RMESCAPE_HEAP) {
1471 r = ckmalloc(fulllen);
1472 } else {
1473--
14741.5.5
1475
1476From ea180ade7ece7780de8b90b80950fef75a00654d Mon Sep 17 00:00:00 2001
1477From: Herbert Xu <herbert@gondor.apana.org.au>
1478Date: Wed, 26 Sep 2007 17:14:16 +0800
1479Subject: [PATCH] [PARSER] Recognise here-doc delimiters terminated by EOF
1480
1481Previously dash required a <newline> character to be present in order for
1482a here-document delimiter to be detected. Allowing EOF in the absence of
1483a <newline> to play the same purpose allows some intuitive scripts to
1484succeed. POSIX seems to be silence on this so this should be OK.
1485
1486Test case:
1487
1488 eval 'cat <<- NOT
1489 test
1490 NOT'
1491 echo OK
1492
1493Old result:
1494
1495 test
1496 NOTOK
1497
1498New result:
1499
1500 test
1501 OK
1502---
1503 ChangeLog | 4 ++++
1504 src/parser.c | 10 ++++++++--
1505 2 files changed, 12 insertions(+), 2 deletions(-)
1506
1507diff --git a/ChangeLog b/ChangeLog
1508index 670682b..cf56c9a 100644
1509--- a/ChangeLog
1510+++ b/ChangeLog
1511@@ -1,3 +1,7 @@
1512+2007-09-26 Herbert Xu <herbert@gondor.apana.org.au>
1513+
1514+ * Recognise here-doc delimiters terminated by EOF.
1515+
1516 2007-09-26 Roy Marples <uberlord@gentoo.org>
1517
1518 * Refresh stack pointers after makestrspace in _rmescapes.
1519diff --git a/src/parser.c b/src/parser.c
1520index 1a483d4..cac0aa5 100644
1521--- a/src/parser.c
1522+++ b/src/parser.c
1523@@ -1049,8 +1049,14 @@ checkend: {
1524 char *p, *q;
1525
1526 p = line;
1527- for (q = eofmark + 1 ; *q && *p == *q ; p++, q++);
1528- if (*p == '\n' && *q == '\0') {
1529+ for (q = eofmark + 1;; p++, q++) {
1530+ c = *p;
1531+ if (c == '\n')
1532+ c = 0;
1533+ if (!*q || c != *q)
1534+ break;
1535+ }
1536+ if (c == *q) {
1537 c = PEOF;
1538 plinno++;
1539 needprompt = doprompt;
1540--
15411.5.5
1542
1543From 0150a7be130d6c54e286ca9fe5d72ba80f84ccf9 Mon Sep 17 00:00:00 2001
1544From: Alexey Gladkov <legion@altlinux.org>
1545Date: Thu, 4 Oct 2007 14:21:44 +0800
1546Subject: [PATCH] [BUILD] Add --enable-static option to configure.
1547
1548Add new option to build statical linked dash.
1549---
1550 ChangeLog | 4 ++++
1551 configure.ac | 6 ++++++
1552 2 files changed, 10 insertions(+), 0 deletions(-)
1553
1554diff --git a/ChangeLog b/ChangeLog
1555index cf56c9a..ac717c5 100644
1556--- a/ChangeLog
1557+++ b/ChangeLog
1558@@ -1,3 +1,7 @@
1559+2007-10-04 Alexey Gladkov <legion@altlinux.org>
1560+
1561+ * Add --enable-static option to configure.
1562+
1563 2007-09-26 Herbert Xu <herbert@gondor.apana.org.au>
1564
1565 * Recognise here-doc delimiters terminated by EOF.
1566diff --git a/configure.ac b/configure.ac
1567index e0a94a8..5e8f17d 100644
1568--- a/configure.ac
1569+++ b/configure.ac
1570@@ -18,6 +18,12 @@ fi
1571 AC_MSG_RESULT(${CC_FOR_BUILD})
1572 AC_SUBST(CC_FOR_BUILD)
1573
1574+AC_ARG_ENABLE(static, AS_HELP_STRING(--enable-static, \
1575+ [Build statical linked program]))
1576+if test "$enable_static" = "yes"; then
1577+ export LDFLAGS="-static -Wl,--fatal-warnings"
1578+fi
1579+
1580 dnl Checks for libraries.
1581
1582 dnl Checks for header files.
1583--
15841.5.5
1585
1586From d4f9f079e000e1fb04ab58cac1c3aeabc190a344 Mon Sep 17 00:00:00 2001
1587From: Herbert Xu <herbert@gondor.apana.org.au>
1588Date: Thu, 4 Oct 2007 22:15:10 +0800
1589Subject: [PATCH] [PARSER] Fix parsing of ${##1}
1590
1591Previously dash treated ${##1} as a length operation. This patch fixes that.
1592
1593Test case:
1594
1595 set -- a
1596 echo ${##1}OK
1597
1598Old result:
1599
1600 1OK
1601
1602New result:
1603
1604 OK
1605---
1606 ChangeLog | 4 ++++
1607 src/parser.c | 31 ++++++++++++++++++++++---------
1608 2 files changed, 26 insertions(+), 9 deletions(-)
1609
1610diff --git a/ChangeLog b/ChangeLog
1611index ac717c5..3352429 100644
1612--- a/ChangeLog
1613+++ b/ChangeLog
1614@@ -1,3 +1,7 @@
1615+2007-10-04 Herbert Xu <herbert@gondor.apana.org.au>
1616+
1617+ * Fix parsing of ${##1}.
1618+
1619 2007-10-04 Alexey Gladkov <legion@altlinux.org>
1620
1621 * Add --enable-static option to configure.
1622diff --git a/src/parser.c b/src/parser.c
1623index cac0aa5..9edb824 100644
1624--- a/src/parser.c
1625+++ b/src/parser.c
1626@@ -1167,15 +1167,9 @@ parsesub: {
1627 subtype = VSNORMAL;
1628 if (c == '{') {
1629 c = pgetc();
1630- if (c == '#') {
1631- if ((c = pgetc()) == '}')
1632- c = '#';
1633- else
1634- subtype = VSLENGTH;
1635- }
1636- else
1637- subtype = 0;
1638+ subtype = 0;
1639 }
1640+varname:
1641 if (c > PEOA && is_name(c)) {
1642 do {
1643 STPUTC(c, out);
1644@@ -1188,8 +1182,27 @@ parsesub: {
1645 } while (is_digit(c));
1646 }
1647 else if (is_special(c)) {
1648- USTPUTC(c, out);
1649+ int cc = c;
1650+
1651 c = pgetc();
1652+
1653+ if (!subtype && cc == '#') {
1654+ subtype = VSLENGTH;
1655+
1656+ if (c == '_' || isalnum(c))
1657+ goto varname;
1658+
1659+ cc = c;
1660+ c = pgetc();
1661+ if (cc == '}' || c != '}') {
1662+ pungetc();
1663+ subtype = 0;
1664+ c = cc;
1665+ cc = '#';
1666+ }
1667+ }
1668+
1669+ USTPUTC(cc, out);
1670 }
1671 else
1672 badsub: synerror("Bad substitution");
1673--
16741.5.5
1675
1676From 903e743d0593b31c430a4182fabba1f4ed9dac4a Mon Sep 17 00:00:00 2001
1677From: Herbert Xu <herbert@gondor.apana.org.au>
1678Date: Thu, 4 Oct 2007 22:20:38 +0800
1679Subject: [PATCH] [PARSER] Size optimisations in parameter expansion parser
1680
1681Merge flags into subtype.
1682Do not write subtype out twice.
1683Add likely flag on ${ vs. $NAME.
1684Kill unnecessary (and bogus) PEOA check.
1685---
1686 ChangeLog | 1 +
1687 src/parser.c | 16 +++++++---------
1688 2 files changed, 8 insertions(+), 9 deletions(-)
1689
1690diff --git a/ChangeLog b/ChangeLog
1691index 3352429..940e4b0 100644
1692--- a/ChangeLog
1693+++ b/ChangeLog
1694@@ -1,6 +1,7 @@
1695 2007-10-04 Herbert Xu <herbert@gondor.apana.org.au>
1696
1697 * Fix parsing of ${##1}.
1698+ * Size optimisations in parameter expansion parser.
1699
1700 2007-10-04 Alexey Gladkov <legion@altlinux.org>
1701
1702diff --git a/src/parser.c b/src/parser.c
1703index 9edb824..f49ee7d 100644
1704--- a/src/parser.c
1705+++ b/src/parser.c
1706@@ -1142,7 +1142,6 @@ parseredir: {
1707 parsesub: {
1708 int subtype;
1709 int typeloc;
1710- int flags;
1711 char *p;
1712 static const char types[] = "}-+?=";
1713
1714@@ -1163,18 +1162,18 @@ parsesub: {
1715 } else {
1716 USTPUTC(CTLVAR, out);
1717 typeloc = out - (char *)stackblock();
1718- USTPUTC(VSNORMAL, out);
1719+ STADJUST(1, out);
1720 subtype = VSNORMAL;
1721- if (c == '{') {
1722+ if (likely(c == '{')) {
1723 c = pgetc();
1724 subtype = 0;
1725 }
1726 varname:
1727- if (c > PEOA && is_name(c)) {
1728+ if (is_name(c)) {
1729 do {
1730 STPUTC(c, out);
1731 c = pgetc();
1732- } while (c > PEOA && is_in_name(c));
1733+ } while (is_in_name(c));
1734 } else if (is_digit(c)) {
1735 do {
1736 STPUTC(c, out);
1737@@ -1208,18 +1207,17 @@ varname:
1738 badsub: synerror("Bad substitution");
1739
1740 STPUTC('=', out);
1741- flags = 0;
1742 if (subtype == 0) {
1743 switch (c) {
1744 case ':':
1745- flags = VSNUL;
1746+ subtype = VSNUL;
1747 c = pgetc();
1748 /*FALLTHROUGH*/
1749 default:
1750 p = strchr(types, c);
1751 if (p == NULL)
1752 goto badsub;
1753- subtype = p - types + VSNORMAL;
1754+ subtype |= p - types + VSNORMAL;
1755 break;
1756 case '%':
1757 case '#':
1758@@ -1238,7 +1236,7 @@ badsub: synerror("Bad substitution");
1759 } else {
1760 pungetc();
1761 }
1762- *((char *)stackblock() + typeloc) = subtype | flags;
1763+ *((char *)stackblock() + typeloc) = subtype;
1764 if (subtype != VSNORMAL) {
1765 varnest++;
1766 if (dblquote)
1767--
17681.5.5
1769
1770From ade5f31819251f8fbe9f98f4d3d7f2d9ec0d56d5 Mon Sep 17 00:00:00 2001
1771From: Herbert Xu <herbert@gondor.apana.org.au>
1772Date: Fri, 5 Oct 2007 23:26:45 +0800
1773Subject: [PATCH] [MEMALLOC] Made grabstackblock an inline wrapper for stalloc
1774
1775The function grabstackblock is identical in semantics to stalloc within its
1776input constraints.
1777---
1778 ChangeLog | 4 ++++
1779 src/memalloc.c | 8 --------
1780 src/memalloc.h | 6 +++++-
1781 3 files changed, 9 insertions(+), 9 deletions(-)
1782
1783diff --git a/ChangeLog b/ChangeLog
1784index 940e4b0..383332c 100644
1785--- a/ChangeLog
1786+++ b/ChangeLog
1787@@ -1,3 +1,7 @@
1788+2007-10-05 Herbert Xu <herbert@gondor.apana.org.au>
1789+
1790+ * Made grabstackblock an inline wrapper for stalloc.
1791+
1792 2007-10-04 Herbert Xu <herbert@gondor.apana.org.au>
1793
1794 * Fix parsing of ${##1}.
1795diff --git a/src/memalloc.c b/src/memalloc.c
1796index 358e6ec..c8147d3 100644
1797--- a/src/memalloc.c
1798+++ b/src/memalloc.c
1799@@ -254,14 +254,6 @@ growstackblock(void)
1800 }
1801 }
1802
1803-void
1804-grabstackblock(size_t len)
1805-{
1806- len = SHELL_ALIGN(len);
1807- stacknxt += len;
1808- stacknleft -= len;
1809-}
1810-
1811 /*
1812 * The following routines are somewhat easier to use than the above.
1813 * The user declares a variable of type STACKSTR, which may be declared
1814diff --git a/src/memalloc.h b/src/memalloc.h
1815index 8a41e64..282dbb0 100644
1816--- a/src/memalloc.h
1817+++ b/src/memalloc.h
1818@@ -57,13 +57,17 @@ void stunalloc(pointer);
1819 void setstackmark(struct stackmark *);
1820 void popstackmark(struct stackmark *);
1821 void growstackblock(void);
1822-void grabstackblock(size_t);
1823 void *growstackstr(void);
1824 char *makestrspace(size_t, char *);
1825 char *stnputs(const char *, size_t, char *);
1826 char *stputs(const char *, char *);
1827
1828
1829+static inline void grabstackblock(size_t len)
1830+{
1831+ stalloc(len);
1832+}
1833+
1834 static inline char *_STPUTC(int c, char *p) {
1835 if (p == sstrend)
1836 p = growstackstr();
1837--
18381.5.5
1839
1840From 4c0f98546aa3f6e74a2062ed4a3dd9589f012269 Mon Sep 17 00:00:00 2001
1841From: Herbert Xu <herbert@gondor.apana.org.au>
1842Date: Sat, 6 Oct 2007 00:45:52 +0800
1843Subject: [PATCH] [MEMALLOC] Add pushstackmark
1844
1845This patch gets rid of the stack mark tracking hack by allocating a little
1846bit of stack memory if we're at risk of planting a stack mark which may be
1847grown later. To do this a new function pushstackmark is added which lets
1848the user pick a bigger amount to allocate since some users do that anyway
1849after setting a stack mark.
1850---
1851 ChangeLog | 4 ++++
1852 src/expand.c | 6 ++----
1853 src/memalloc.c | 26 +++++++-------------------
1854 src/memalloc.h | 2 +-
1855 src/parser.c | 3 +--
1856 5 files changed, 15 insertions(+), 26 deletions(-)
1857
1858diff --git a/ChangeLog b/ChangeLog
1859index 383332c..d3c7320 100644
1860--- a/ChangeLog
1861+++ b/ChangeLog
1862@@ -1,3 +1,7 @@
1863+2007-10-06 Herbert Xu <herbert@gondor.apana.org.au>
1864+
1865+ * Add pushstackmark.
1866+
1867 2007-10-05 Herbert Xu <herbert@gondor.apana.org.au>
1868
1869 * Made grabstackblock an inline wrapper for stalloc.
1870diff --git a/src/expand.c b/src/expand.c
1871index 98ad718..e3e5d8f 100644
1872--- a/src/expand.c
1873+++ b/src/expand.c
1874@@ -546,10 +546,8 @@ expbackq(union node *cmd, int flag)
1875 struct stackmark smark;
1876
1877 INTOFF;
1878- setstackmark(&smark);
1879- dest = expdest;
1880- startloc = dest - (char *)stackblock();
1881- grabstackstr(dest);
1882+ startloc = expdest - (char *)stackblock();
1883+ pushstackmark(&smark, startloc);
1884 evalbackcmd(cmd, (struct backcmd *) &in);
1885 popstackmark(&smark);
1886
1887diff --git a/src/memalloc.c b/src/memalloc.c
1888index c8147d3..8d3e2ed 100644
1889--- a/src/memalloc.c
1890+++ b/src/memalloc.c
1891@@ -106,7 +106,6 @@ struct stack_block {
1892
1893 struct stack_block stackbase;
1894 struct stack_block *stackp = &stackbase;
1895-struct stackmark *markp;
1896 char *stacknxt = stackbase.space;
1897 size_t stacknleft = MINSIZE;
1898 char *sstrend = stackbase.space + MINSIZE;
1899@@ -161,14 +160,17 @@ stunalloc(pointer p)
1900
1901
1902
1903-void
1904-setstackmark(struct stackmark *mark)
1905+void pushstackmark(struct stackmark *mark, size_t len)
1906 {
1907 mark->stackp = stackp;
1908 mark->stacknxt = stacknxt;
1909 mark->stacknleft = stacknleft;
1910- mark->marknext = markp;
1911- markp = mark;
1912+ grabstackblock(len);
1913+}
1914+
1915+void setstackmark(struct stackmark *mark)
1916+{
1917+ pushstackmark(mark, stacknxt == stackp->space && stackp != &stackbase);
1918 }
1919
1920
1921@@ -178,7 +180,6 @@ popstackmark(struct stackmark *mark)
1922 struct stack_block *sp;
1923
1924 INTOFF;
1925- markp = mark->marknext;
1926 while (stackp != mark->stackp) {
1927 sp = stackp;
1928 stackp = sp->prev;
1929@@ -214,7 +215,6 @@ growstackblock(void)
1930
1931 if (stacknxt == stackp->space && stackp != &stackbase) {
1932 struct stack_block *oldstackp;
1933- struct stackmark *xmark;
1934 struct stack_block *sp;
1935 struct stack_block *prevstackp;
1936 size_t grosslen;
1937@@ -230,18 +230,6 @@ growstackblock(void)
1938 stacknxt = sp->space;
1939 stacknleft = newlen;
1940 sstrend = sp->space + newlen;
1941-
1942- /*
1943- * Stack marks pointing to the start of the old block
1944- * must be relocated to point to the new block
1945- */
1946- xmark = markp;
1947- while (xmark != NULL && xmark->stackp == oldstackp) {
1948- xmark->stackp = stackp;
1949- xmark->stacknxt = stacknxt;
1950- xmark->stacknleft = stacknleft;
1951- xmark = xmark->marknext;
1952- }
1953 INTON;
1954 } else {
1955 char *oldspace = stacknxt;
1956diff --git a/src/memalloc.h b/src/memalloc.h
1957index 282dbb0..ad6015d 100644
1958--- a/src/memalloc.h
1959+++ b/src/memalloc.h
1960@@ -40,7 +40,6 @@ struct stackmark {
1961 struct stack_block *stackp;
1962 char *stacknxt;
1963 size_t stacknleft;
1964- struct stackmark *marknext;
1965 };
1966
1967
1968@@ -54,6 +53,7 @@ pointer ckrealloc(pointer, size_t);
1969 char *savestr(const char *);
1970 pointer stalloc(size_t);
1971 void stunalloc(pointer);
1972+void pushstackmark(struct stackmark *mark, size_t len);
1973 void setstackmark(struct stackmark *);
1974 void popstackmark(struct stackmark *);
1975 void growstackblock(void);
1976diff --git a/src/parser.c b/src/parser.c
1977index f49ee7d..d0e0553 100644
1978--- a/src/parser.c
1979+++ b/src/parser.c
1980@@ -1487,8 +1487,7 @@ setprompt(int which)
1981 show = !el;
1982 #endif
1983 if (show) {
1984- setstackmark(&smark);
1985- stalloc(stackblocksize());
1986+ pushstackmark(&smark, stackblocksize());
1987 out2str(getprompt(NULL));
1988 popstackmark(&smark);
1989 }
1990--
19911.5.5
1992
1993From ee88381ece2dad9524f924b08e40045034eda0f5 Mon Sep 17 00:00:00 2001
1994From: Herbert Xu <herbert@gondor.apana.org.au>
1995Date: Sat, 6 Oct 2007 18:59:31 +0800
1996Subject: [PATCH] [BUILTIN] Treat OPTIND=0 in the same way as OPTIND=1
1997
1998Previously setting OPTIND to 0 would cause subsequent getopts calls to fail.
1999This patch makes dash reset the getopts parameters the same way as OPTIND=1.
2000
2001Both behaviours are allowed by POSIX but other common shells do tolerate this
2002case.
2003---
2004 ChangeLog | 1 +
2005 src/options.c | 4 +---
2006 2 files changed, 2 insertions(+), 3 deletions(-)
2007
2008diff --git a/ChangeLog b/ChangeLog
2009index d3c7320..11cdb67 100644
2010--- a/ChangeLog
2011+++ b/ChangeLog
2012@@ -1,6 +1,7 @@
2013 2007-10-06 Herbert Xu <herbert@gondor.apana.org.au>
2014
2015 * Add pushstackmark.
2016+ * Treat OPTIND=0 in the same way as OPTIND=1.
2017
2018 2007-10-05 Herbert Xu <herbert@gondor.apana.org.au>
2019
2020diff --git a/src/options.c b/src/options.c
2021index 85f1406..045345a 100644
2022--- a/src/options.c
2023+++ b/src/options.c
2024@@ -377,7 +377,7 @@ void
2025 getoptsreset(value)
2026 const char *value;
2027 {
2028- shellparam.optind = number(value);
2029+ shellparam.optind = number(value) ?: 1;
2030 shellparam.optoff = -1;
2031 }
2032
2033@@ -424,8 +424,6 @@ getopts(char *optstr, char *optvar, char **optfirst, int *optind, int *optoff)
2034 char s[12];
2035 char **optnext;
2036
2037- if (*optind < 1)
2038- return 1;
2039 optnext = optfirst + *optind - 1;
2040
2041 if (*optind <= 1 || *optoff < 0 || strlen(optnext[-1]) < *optoff)
2042--
20431.5.5
2044
2045From c699fa24176e084ea93c9dd7058511d97d218e20 Mon Sep 17 00:00:00 2001
2046From: Herbert Xu <herbert@gondor.apana.org.au>
2047Date: Sat, 6 Oct 2007 21:18:58 +0800
2048Subject: [PATCH] [VAR] Remove setvarsafe
2049
2050The only user of setvarsafe is getopts. However, we can achieve the same
2051result by pre-setting the value of shellparam.optind.
2052---
2053 ChangeLog | 1 +
2054 src/options.c | 48 +++++++++++++++++++++++-------------------------
2055 src/var.c | 25 -------------------------
2056 src/var.h | 1 -
2057 4 files changed, 24 insertions(+), 51 deletions(-)
2058
2059diff --git a/ChangeLog b/ChangeLog
2060index 11cdb67..ea54d84 100644
2061--- a/ChangeLog
2062+++ b/ChangeLog
2063@@ -2,6 +2,7 @@
2064
2065 * Add pushstackmark.
2066 * Treat OPTIND=0 in the same way as OPTIND=1.
2067+ * Remove setvarsafe.
2068
2069 2007-10-05 Herbert Xu <herbert@gondor.apana.org.au>
2070
2071diff --git a/src/options.c b/src/options.c
2072index 045345a..568148a 100644
2073--- a/src/options.c
2074+++ b/src/options.c
2075@@ -109,7 +109,7 @@ char optlist[NOPTS];
2076 STATIC void options(int);
2077 STATIC void minus_o(char *, int);
2078 STATIC void setoption(int, int);
2079-STATIC int getopts(char *, char *, char **, int *, int *);
2080+STATIC int getopts(char *, char *, char **);
2081
2082
2083 /*
2084@@ -397,39 +397,40 @@ getoptscmd(int argc, char **argv)
2085 sh_error("Usage: getopts optstring var [arg]");
2086 else if (argc == 3) {
2087 optbase = shellparam.p;
2088- if (shellparam.optind > shellparam.nparam + 1) {
2089+ if ((unsigned)shellparam.optind > shellparam.nparam + 1) {
2090 shellparam.optind = 1;
2091 shellparam.optoff = -1;
2092 }
2093 }
2094 else {
2095 optbase = &argv[3];
2096- if (shellparam.optind > argc - 2) {
2097+ if ((unsigned)shellparam.optind > argc - 2) {
2098 shellparam.optind = 1;
2099 shellparam.optoff = -1;
2100 }
2101 }
2102
2103- return getopts(argv[1], argv[2], optbase, &shellparam.optind,
2104- &shellparam.optoff);
2105+ return getopts(argv[1], argv[2], optbase);
2106 }
2107
2108 STATIC int
2109-getopts(char *optstr, char *optvar, char **optfirst, int *optind, int *optoff)
2110+getopts(char *optstr, char *optvar, char **optfirst)
2111 {
2112 char *p, *q;
2113 char c = '?';
2114 int done = 0;
2115- int err = 0;
2116 char s[12];
2117 char **optnext;
2118+ int ind = shellparam.optind;
2119+ int off = shellparam.optoff;
2120
2121- optnext = optfirst + *optind - 1;
2122+ shellparam.optind = -1;
2123+ optnext = optfirst + ind - 1;
2124
2125- if (*optind <= 1 || *optoff < 0 || strlen(optnext[-1]) < *optoff)
2126+ if (ind <= 1 || off < 0 || strlen(optnext[-1]) < off)
2127 p = NULL;
2128 else
2129- p = optnext[-1] + *optoff;
2130+ p = optnext[-1] + off;
2131 if (p == NULL || *p == '\0') {
2132 /* Current word is done, advance */
2133 p = *optnext;
2134@@ -450,7 +451,7 @@ atend:
2135 if (optstr[0] == ':') {
2136 s[0] = c;
2137 s[1] = '\0';
2138- err |= setvarsafe("OPTARG", s, 0);
2139+ setvar("OPTARG", s, 0);
2140 } else {
2141 outfmt(&errout, "Illegal option -%c\n", c);
2142 (void) unsetvar("OPTARG");
2143@@ -467,7 +468,7 @@ atend:
2144 if (optstr[0] == ':') {
2145 s[0] = c;
2146 s[1] = '\0';
2147- err |= setvarsafe("OPTARG", s, 0);
2148+ setvar("OPTARG", s, 0);
2149 c = ':';
2150 } else {
2151 outfmt(&errout, "No arg for -%c option\n", c);
2152@@ -479,25 +480,22 @@ atend:
2153
2154 if (p == *optnext)
2155 optnext++;
2156- err |= setvarsafe("OPTARG", p, 0);
2157+ setvar("OPTARG", p, 0);
2158 p = NULL;
2159 } else
2160- err |= setvarsafe("OPTARG", nullstr, 0);
2161+ setvar("OPTARG", nullstr, 0);
2162
2163 out:
2164- *optoff = p ? p - *(optnext - 1) : -1;
2165- *optind = optnext - optfirst + 1;
2166- fmtstr(s, sizeof(s), "%d", *optind);
2167- err |= setvarsafe("OPTIND", s, VNOFUNC);
2168+ ind = optnext - optfirst + 1;
2169+ fmtstr(s, sizeof(s), "%d", ind);
2170+ setvar("OPTIND", s, VNOFUNC);
2171 s[0] = c;
2172 s[1] = '\0';
2173- err |= setvarsafe(optvar, s, 0);
2174- if (err) {
2175- *optind = 1;
2176- *optoff = -1;
2177- flushall();
2178- exraise(EXERROR);
2179- }
2180+ setvar(optvar, s, 0);
2181+
2182+ shellparam.optoff = p ? p - *(optnext - 1) : -1;
2183+ shellparam.optind = ind;
2184+
2185 return done;
2186 }
2187
2188diff --git a/src/var.c b/src/var.c
2189index 3263dc5..501a279 100644
2190--- a/src/var.c
2191+++ b/src/var.c
2192@@ -168,31 +168,6 @@ initvar(void)
2193 }
2194
2195 /*
2196- * Safe version of setvar, returns 1 on success 0 on failure.
2197- */
2198-
2199-int
2200-setvarsafe(const char *name, const char *val, int flags)
2201-{
2202- int err;
2203- volatile int saveint;
2204- struct jmploc *volatile savehandler = handler;
2205- struct jmploc jmploc;
2206-
2207- SAVEINT(saveint);
2208- if (setjmp(jmploc.loc))
2209- err = 1;
2210- else {
2211- handler = &jmploc;
2212- setvar(name, val, flags);
2213- err = 0;
2214- }
2215- handler = savehandler;
2216- RESTOREINT(saveint);
2217- return err;
2218-}
2219-
2220-/*
2221 * Set the value of a variable. The flags argument is ored with the
2222 * flags of the variable. If val is NULL, the variable is unset.
2223 */
2224diff --git a/src/var.h b/src/var.h
2225index c3c2ca7..ae58c6c 100644
2226--- a/src/var.h
2227+++ b/src/var.h
2228@@ -138,7 +138,6 @@ int localcmd(int, char **);
2229 void poplocalvars(void);
2230 int unsetcmd(int, char **);
2231 int unsetvar(const char *);
2232-int setvarsafe(const char *, const char *, int);
2233 int varcmp(const char *, const char *);
2234
2235 static inline int varequal(const char *a, const char *b) {
2236--
22371.5.5
2238
2239From 8e92ae4cb4ab07ebf88c99c9dcd6219e7ea3297f Mon Sep 17 00:00:00 2001
2240From: Herbert Xu <herbert@gondor.apana.org.au>
2241Date: Sat, 6 Oct 2007 22:42:14 +0800
2242Subject: [PATCH] [BUILTIN] Use intmax_t arithmetic in test
2243
2244This patch adds the function atomax10 and uses it in test(1) so that we
2245support intmax_t comparisons.
2246---
2247 ChangeLog | 1 +
2248 src/bltin/test.c | 31 ++++++-------------------------
2249 src/mystring.c | 34 ++++++++++++++++++++++++++++++++--
2250 src/mystring.h | 2 ++
2251 4 files changed, 41 insertions(+), 27 deletions(-)
2252
2253diff --git a/ChangeLog b/ChangeLog
2254index ea54d84..1db14ac 100644
2255--- a/ChangeLog
2256+++ b/ChangeLog
2257@@ -3,6 +3,7 @@
2258 * Add pushstackmark.
2259 * Treat OPTIND=0 in the same way as OPTIND=1.
2260 * Remove setvarsafe.
2261+ * Use intmax_t arithmetic in test.
2262
2263 2007-10-05 Herbert Xu <herbert@gondor.apana.org.au>
2264
2265diff --git a/src/bltin/test.c b/src/bltin/test.c
2266index 7d49569..bc8b175 100644
2267--- a/src/bltin/test.c
2268+++ b/src/bltin/test.c
2269@@ -11,8 +11,7 @@
2270 #include <sys/stat.h>
2271 #include <sys/types.h>
2272
2273-#include <ctype.h>
2274-#include <errno.h>
2275+#include <stdint.h>
2276 #include <stdlib.h>
2277 #include <string.h>
2278 #include <unistd.h>
2279@@ -145,13 +144,17 @@ static int binop(void);
2280 static int filstat(char *, enum token);
2281 static enum token t_lex(char *);
2282 static int isoperand(void);
2283-static int getn(const char *);
2284 static int newerf(const char *, const char *);
2285 static int olderf(const char *, const char *);
2286 static int equalf(const char *, const char *);
2287 static int test_st_mode(const struct stat64 *, int);
2288 static int bash_group_member(gid_t);
2289
2290+static inline intmax_t getn(const char *s)
2291+{
2292+ return atomax10(s);
2293+}
2294+
2295 int
2296 testcmd(int argc, char **argv)
2297 {
2298@@ -396,28 +399,6 @@ isoperand(void)
2299 return 0;
2300 }
2301
2302-/* atoi with error detection */
2303-static int
2304-getn(const char *s)
2305-{
2306- char *p;
2307- long r;
2308-
2309- errno = 0;
2310- r = strtol(s, &p, 10);
2311-
2312- if (errno != 0)
2313- error("%s: out of range", s);
2314-
2315- while (isspace((unsigned char)*p))
2316- p++;
2317-
2318- if (*p)
2319- error("%s: bad number", s);
2320-
2321- return (int) r;
2322-}
2323-
2324 static int
2325 newerf (const char *f1, const char *f2)
2326 {
2327diff --git a/src/mystring.c b/src/mystring.c
2328index 7d937a8..df1691b 100644
2329--- a/src/mystring.c
2330+++ b/src/mystring.c
2331@@ -42,6 +42,11 @@
2332 * is_number(s) Return true if s is a string of digits.
2333 */
2334
2335+#include <ctype.h>
2336+#include <errno.h>
2337+#include <inttypes.h>
2338+#include <limits.h>
2339+#include <stdint.h>
2340 #include <stdlib.h>
2341 #include "shell.h"
2342 #include "syntax.h"
2343@@ -105,6 +110,29 @@ prefix(const char *string, const char *pfx)
2344
2345
2346 /*
2347+ * Convert a string into an integer of type intmax_t. Alow trailing spaces.
2348+ */
2349+intmax_t atomax10(const char *s)
2350+{
2351+ char *p;
2352+ intmax_t r;
2353+
2354+ errno = 0;
2355+ r = strtoimax(s, &p, 10);
2356+
2357+ if (errno != 0)
2358+ sh_error(illnum, s);
2359+
2360+ while (isspace((unsigned char)*p))
2361+ p++;
2362+
2363+ if (*p)
2364+ sh_error(illnum, s);
2365+
2366+ return r;
2367+}
2368+
2369+/*
2370 * Convert a string of digits to an integer, printing an error message on
2371 * failure.
2372 */
2373@@ -112,10 +140,12 @@ prefix(const char *string, const char *pfx)
2374 int
2375 number(const char *s)
2376 {
2377+ intmax_t n = atomax10(s);
2378
2379- if (! is_number(s))
2380+ if (n < 0 || n > INT_MAX)
2381 sh_error(illnum, s);
2382- return atoi(s);
2383+
2384+ return n;
2385 }
2386
2387
2388diff --git a/src/mystring.h b/src/mystring.h
2389index f451cc2..c9cade6 100644
2390--- a/src/mystring.h
2391+++ b/src/mystring.h
2392@@ -34,6 +34,7 @@
2393 * @(#)mystring.h 8.2 (Berkeley) 5/4/95
2394 */
2395
2396+#include <stdint.h>
2397 #include <string.h>
2398
2399 extern const char snlfmt[];
2400@@ -47,6 +48,7 @@ extern const char homestr[];
2401 void scopyn(const char *, char *, int);
2402 #endif
2403 char *prefix(const char *, const char *);
2404+intmax_t atomax10(const char *);
2405 int number(const char *);
2406 int is_number(const char *);
2407 char *single_quote(const char *);
2408--
24091.5.5
2410
2411From 4cfa59c5a310b4f3ed44867dba7e7afd63ada506 Mon Sep 17 00:00:00 2001
2412From: Herbert Xu <herbert@gondor.apana.org.au>
2413Date: Mon, 8 Oct 2007 21:32:25 +0800
2414Subject: [PATCH] [PARSER] Report substition errors at expansion time
2415
2416On Wed, Apr 11, 2007 at 01:24:21PM -0700, Micah Cowan wrote:
2417> Package: dash
2418> Version: 0.5.3-3
2419>
2420> Bug first reported against Ubuntu at
2421> https://bugs.launchpad.net/ubuntu/+source/dash/+bug/105634
2422> by Paul Smith
2423>
2424> The description and some comments from that bug report follow.
2425>
2426> -----
2427>
2428> This operation fails on Ubuntu:
2429>
2430> $ /bin/sh -c 'if false; then d="${foo/bar}"; fi'
2431> /bin/sh: Syntax error: Bad substitution
2432>
2433> When used with other POSIX shells it succeeds. While semantically the
2434> variable reference ${foo/bar} is not valid, this is not a syntax error
2435> according to POSIX, and since the variable assignment expression is
2436> never invoked (because it's within an "if false") it should not be seen
2437> as an error.
2438>
2439> I ran into this because after restarting my system I could no longer log
2440> in. It turns out that the problem was (a) I had edited .gnomerc to
2441> source my .bashrc file so that my environment would be set properly, and
2442> (b) I had added some new code to my .bashrc WITHIN A CHECK FOR BASH!
2443> that used bash's ${var/match/sub} feature. Even though this code was
2444> within a "case $BASH_VERSION; in *[0-9]*) ... esac (so dash would never
2445> execute it since that variable is not set), it still caused dash to
2446> throw up.
2447>
2448> -----
2449>
2450> FYI, some relevant details from POSIX:
2451>
2452> Section 2.3, Token Recognition:
2453>
2454> 5. If the current character is an unquoted '$' or '`', the shell shall
2455> identify the start of any candidates for parameter expansion ( Parameter
2456> Expansion), command substitution ( Command Substitution), or arithmetic
2457> expansion ( Arithmetic Expansion) from their introductory unquoted
2458> character sequences: '$' or "${", "$(" or '`', and "$((", respectively.
2459> The shell shall read sufficient input to determine the end of the unit
2460> to be expanded (as explained in the cited sections).
2461>
2462> Section 2.6.2, Parameter Expansion:
2463>
2464> The format for parameter expansion is as follows:
2465>
2466> ${expression}
2467>
2468> where expression consists of all characters until the matching '}'. Any
2469> '}' escaped by a backslash or within a quoted string, and characters in
2470> embedded arithmetic expansions, command substitutions, and variable
2471> expansions, shall not be examined in determining the matching '}'.
2472>
2473> [...]
2474>
2475> The parameter name or symbol can be enclosed in braces, which are
2476> optional except for positional parameters with more than one digit or
2477> when parameter is followed by a character that could be interpreted as
2478> part of the name. The matching closing brace shall be determined by
2479> counting brace levels, skipping over enclosed quoted strings, and
2480> command substitutions.
2481>
2482> ---
2483>
2484> In addition to bash I've checked Solaris /bin/sh and ksh and they don't
2485> report an error.
2486>
2487> -----
2488> Micah Cowan:
2489>
2490> The applicable portion of POSIX is in XCU 2.10.1:
2491>
2492> "The WORD tokens shall have the word expansion rules applied to them
2493> immediately before the associated command is executed, not at the time
2494> the command is parsed."
2495>
2496> This seems fairly clear to me.
2497
2498This patch moves the error detection to expansion time.
2499
2500Test case:
2501
2502 if false; then
2503 echo ${a!7}
2504 fi
2505 echo OK
2506
2507Old result:
2508
2509 dash: Syntax error: Bad substitution
2510
2511New result:
2512
2513 OK
2514---
2515 ChangeLog | 4 ++++
2516 src/expand.c | 4 ++++
2517 src/parser.c | 7 ++++---
2518 3 files changed, 12 insertions(+), 3 deletions(-)
2519
2520diff --git a/ChangeLog b/ChangeLog
2521index 1db14ac..69ba464 100644
2522--- a/ChangeLog
2523+++ b/ChangeLog
2524@@ -1,3 +1,7 @@
2525+2007-10-08 Herbert Xu <herbert@gondor.apana.org.au>
2526+
2527+ * Report substition errors at expansion time.
2528+
2529 2007-10-06 Herbert Xu <herbert@gondor.apana.org.au>
2530
2531 * Add pushstackmark.
2532diff --git a/src/expand.c b/src/expand.c
2533index e3e5d8f..54fe908 100644
2534--- a/src/expand.c
2535+++ b/src/expand.c
2536@@ -749,6 +749,10 @@ evalvar(char *p, int flag)
2537
2538 varflags = *p++;
2539 subtype = varflags & VSTYPE;
2540+
2541+ if (!subtype)
2542+ sh_error("Bad substitution");
2543+
2544 quoted = flag & EXP_QUOTED;
2545 var = p;
2546 easy = (!quoted || (*var == '@' && shellparam.nparam));
2547diff --git a/src/parser.c b/src/parser.c
2548index d0e0553..4b8a5fe 100644
2549--- a/src/parser.c
2550+++ b/src/parser.c
2551@@ -1204,9 +1204,8 @@ varname:
2552 USTPUTC(cc, out);
2553 }
2554 else
2555-badsub: synerror("Bad substitution");
2556+ goto badsub;
2557
2558- STPUTC('=', out);
2559 if (subtype == 0) {
2560 switch (c) {
2561 case ':':
2562@@ -1216,7 +1215,7 @@ badsub: synerror("Bad substitution");
2563 default:
2564 p = strchr(types, c);
2565 if (p == NULL)
2566- goto badsub;
2567+ break;
2568 subtype |= p - types + VSNORMAL;
2569 break;
2570 case '%':
2571@@ -1234,6 +1233,7 @@ badsub: synerror("Bad substitution");
2572 }
2573 }
2574 } else {
2575+badsub:
2576 pungetc();
2577 }
2578 *((char *)stackblock() + typeloc) = subtype;
2579@@ -1242,6 +1242,7 @@ badsub: synerror("Bad substitution");
2580 if (dblquote)
2581 dqvarnest++;
2582 }
2583+ STPUTC('=', out);
2584 }
2585 goto parsesub_return;
2586 }
2587--
25881.5.5
2589
2590From 1e0d45a1c6d749533b090a2d7068b9c36a1473fe Mon Sep 17 00:00:00 2001
2591From: Herbert Xu <herbert@gondor.apana.org.au>
2592Date: Thu, 11 Oct 2007 22:36:28 +0800
2593Subject: [PATCH] [ARITH] Add assignment and intmax_t support
2594
2595This patch adds assignment operator support in arithmetic expansions. It
2596also changes the type used to intmax_t.
2597---
2598 ChangeLog | 4 +
2599 src/Makefile.am | 8 +-
2600 src/arith.y | 155 ---------------------------
2601 src/arith_yacc.c | 298 +++++++++++++++++++++++++++++++++++++++++++++++++++++
2602 src/arith_yacc.h | 89 ++++++++++++++++
2603 src/arith_yylex.c | 114 +++++++++++++++++----
2604 src/expand.c | 23 +++--
2605 src/expand.h | 4 +-
2606 src/mystring.c | 9 ++-
2607 src/mystring.h | 1 +
2608 src/shell.h | 10 ++
2609 src/var.c | 20 ++++
2610 src/var.h | 4 +
2611 13 files changed, 549 insertions(+), 190 deletions(-)
2612 delete mode 100644 src/arith.y
2613 create mode 100644 src/arith_yacc.c
2614 create mode 100644 src/arith_yacc.h
2615
2616diff --git a/ChangeLog b/ChangeLog
2617index 69ba464..895c607 100644
2618--- a/ChangeLog
2619+++ b/ChangeLog
2620@@ -1,3 +1,7 @@
2621+2007-10-11 Herbert Xu <herbert@gondor.apana.org.au>
2622+
2623+ * Add assignment support in arithmetic expansions.
2624+
2625 2007-10-08 Herbert Xu <herbert@gondor.apana.org.au>
2626
2627 * Report substition errors at expansion time.
2628diff --git a/src/Makefile.am b/src/Makefile.am
2629index 37d6d3c..49026a3 100644
2630--- a/src/Makefile.am
2631+++ b/src/Makefile.am
2632@@ -18,12 +18,12 @@ COMPILE_FOR_BUILD = \
2633 bin_PROGRAMS = dash
2634
2635 dash_CFILES = \
2636- alias.c arith_yylex.c cd.c error.c eval.c exec.c expand.c \
2637+ alias.c arith_yacc.c arith_yylex.c cd.c error.c eval.c exec.c expand.c \
2638 histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \
2639 mystring.c options.c parser.c redir.c show.c trap.c output.c \
2640 bltin/printf.c system.c bltin/test.c bltin/times.c var.c
2641 dash_SOURCES = \
2642- $(dash_CFILES) arith.y \
2643+ $(dash_CFILES) \
2644 alias.h bltin/bltin.h cd.h error.h eval.h exec.h expand.h hetio.h \
2645 init.h input.h jobs.h machdep.h mail.h main.h memalloc.h miscbltin.h \
2646 myhistedit.h mystring.h options.h output.h parser.h redir.h shell.h \
2647@@ -32,10 +32,10 @@ dash_LDADD = builtins.o init.o nodes.o signames.o syntax.o
2648
2649 HELPERS = mkinit mksyntax mknodes mksignames
2650
2651-BUILT_SOURCES = arith.h builtins.h nodes.h syntax.h token.h
2652+BUILT_SOURCES = builtins.h nodes.h syntax.h token.h
2653 CLEANFILES = \
2654 $(BUILT_SOURCES) $(patsubst %.o,%.c,$(dash_LDADD)) \
2655- arith.c $(HELPERS) builtins.def
2656+ $(HELPERS) builtins.def
2657
2658 man_MANS = dash.1
2659 EXTRA_DIST = \
2660diff --git a/src/arith.y b/src/arith.y
2661deleted file mode 100644
2662index 07b0b39..0000000
2663--- a/src/arith.y
2664+++ /dev/null
2665@@ -1,155 +0,0 @@
2666-%{
2667-/*-
2668- * Copyright (c) 1993
2669- * The Regents of the University of California. All rights reserved.
2670- * Copyright (c) 1997-2005
2671- * Herbert Xu <herbert@gondor.apana.org.au>. All rights reserved.
2672- *
2673- * This code is derived from software contributed to Berkeley by
2674- * Kenneth Almquist.
2675- *
2676- * Redistribution and use in source and binary forms, with or without
2677- * modification, are permitted provided that the following conditions
2678- * are met:
2679- * 1. Redistributions of source code must retain the above copyright
2680- * notice, this list of conditions and the following disclaimer.
2681- * 2. Redistributions in binary form must reproduce the above copyright
2682- * notice, this list of conditions and the following disclaimer in the
2683- * documentation and/or other materials provided with the distribution.
2684- * 3. Neither the name of the University nor the names of its contributors
2685- * may be used to endorse or promote products derived from this software
2686- * without specific prior written permission.
2687- *
2688- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2689- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2690- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2691- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2692- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2693- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2694- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2695- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2696- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2697- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2698- * SUCH DAMAGE.
2699- */
2700-
2701-#include <stdlib.h>
2702-#include "expand.h"
2703-#include "shell.h"
2704-#include "error.h"
2705-#include "output.h"
2706-#include "memalloc.h"
2707-
2708-const char *arith_buf, *arith_startbuf;
2709-
2710-#ifndef YYBISON
2711-int yyparse(void);
2712-#endif
2713-void yyerror(const char *);
2714-#ifdef TESTARITH
2715-int main(int , char *[]);
2716-int sh_error(char *);
2717-#endif
2718-
2719-%}
2720-%token ARITH_NUM ARITH_LPAREN ARITH_RPAREN
2721-
2722-%left ARITH_OR
2723-%left ARITH_AND
2724-%left ARITH_BOR
2725-%left ARITH_BXOR
2726-%left ARITH_BAND
2727-%left ARITH_EQ ARITH_NE
2728-%left ARITH_LT ARITH_GT ARITH_GE ARITH_LE
2729-%left ARITH_LSHIFT ARITH_RSHIFT
2730-%left ARITH_ADD ARITH_SUB
2731-%left ARITH_MUL ARITH_DIV ARITH_REM
2732-%left ARITH_UNARYMINUS ARITH_UNARYPLUS ARITH_NOT ARITH_BNOT
2733-%%
2734-
2735-exp: expr {
2736- return ($1);
2737- }
2738- ;
2739-
2740-
2741-expr: ARITH_LPAREN expr ARITH_RPAREN { $$ = $2; }
2742- | expr ARITH_OR expr { $$ = $1 || $3; }
2743- | expr ARITH_AND expr { $$ = $1 && $3; }
2744- | expr ARITH_BOR expr { $$ = $1 | $3; }
2745- | expr ARITH_BXOR expr { $$ = $1 ^ $3; }
2746- | expr ARITH_BAND expr { $$ = $1 & $3; }
2747- | expr ARITH_EQ expr { $$ = $1 == $3; }
2748- | expr ARITH_GT expr { $$ = $1 > $3; }
2749- | expr ARITH_GE expr { $$ = $1 >= $3; }
2750- | expr ARITH_LT expr { $$ = $1 < $3; }
2751- | expr ARITH_LE expr { $$ = $1 <= $3; }
2752- | expr ARITH_NE expr { $$ = $1 != $3; }
2753- | expr ARITH_LSHIFT expr { $$ = $1 << $3; }
2754- | expr ARITH_RSHIFT expr { $$ = $1 >> $3; }
2755- | expr ARITH_ADD expr { $$ = $1 + $3; }
2756- | expr ARITH_SUB expr { $$ = $1 - $3; }
2757- | expr ARITH_MUL expr { $$ = $1 * $3; }
2758- | expr ARITH_DIV expr {
2759- if ($3 == 0)
2760- yyerror("division by zero");
2761- $$ = $1 / $3;
2762- }
2763- | expr ARITH_REM expr {
2764- if ($3 == 0)
2765- yyerror("division by zero");
2766- $$ = $1 % $3;
2767- }
2768- | ARITH_NOT expr { $$ = !($2); }
2769- | ARITH_BNOT expr { $$ = ~($2); }
2770- | ARITH_SUB expr %prec ARITH_UNARYMINUS { $$ = -($2); }
2771- | ARITH_ADD expr %prec ARITH_UNARYPLUS { $$ = $2; }
2772- | ARITH_NUM
2773- ;
2774-%%
2775-int
2776-arith(s)
2777- const char *s;
2778-{
2779- long result;
2780-
2781- arith_buf = arith_startbuf = s;
2782-
2783- INTOFF;
2784- result = yyparse();
2785- arith_lex_reset(); /* reprime lex */
2786- INTON;
2787-
2788- return (result);
2789-}
2790-
2791-
2792-/*************************/
2793-#ifdef TEST_ARITH
2794-#include <stdio.h>
2795-main(argc, argv)
2796- char *argv[];
2797-{
2798- printf("%d\n", exp(argv[1]));
2799-}
2800-sh_error(s)
2801- char *s;
2802-{
2803- fprintf(stderr, "exp: %s\n", s);
2804- exit(1);
2805-}
2806-#endif
2807-
2808-void
2809-yyerror(s)
2810- const char *s;
2811-{
2812-
2813-#ifndef YYBISON
2814- yyerrok;
2815-#endif
2816- yyclearin;
2817- arith_lex_reset(); /* reprime lex */
2818- sh_error("arithmetic expression: %s: \"%s\"", s, arith_startbuf);
2819- /* NOTREACHED */
2820-}
2821diff --git a/src/arith_yacc.c b/src/arith_yacc.c
2822new file mode 100644
2823index 0000000..ad653ed
2824--- /dev/null
2825+++ b/src/arith_yacc.c
2826@@ -0,0 +1,298 @@
2827+/*-
2828+ * Copyright (c) 1993
2829+ * The Regents of the University of California. All rights reserved.
2830+ * Copyright (c) 2007
2831+ * Herbert Xu <herbert@gondor.apana.org.au>. All rights reserved.
2832+ *
2833+ * This code is derived from software contributed to Berkeley by
2834+ * Kenneth Almquist.
2835+ *
2836+ * Redistribution and use in source and binary forms, with or without
2837+ * modification, are permitted provided that the following conditions
2838+ * are met:
2839+ * 1. Redistributions of source code must retain the above copyright
2840+ * notice, this list of conditions and the following disclaimer.
2841+ * 2. Redistributions in binary form must reproduce the above copyright
2842+ * notice, this list of conditions and the following disclaimer in the
2843+ * documentation and/or other materials provided with the distribution.
2844+ * 3. Neither the name of the University nor the names of its contributors
2845+ * may be used to endorse or promote products derived from this software
2846+ * without specific prior written permission.
2847+ *
2848+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2849+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2850+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2851+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2852+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2853+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2854+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2855+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2856+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2857+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2858+ * SUCH DAMAGE.
2859+ */
2860+
2861+#include <inttypes.h>
2862+#include <stdint.h>
2863+#include <stdlib.h>
2864+#include "arith_yacc.h"
2865+#include "expand.h"
2866+#include "shell.h"
2867+#include "error.h"
2868+#include "output.h"
2869+#include "var.h"
2870+
2871+#if ARITH_BOR + 11 != ARITH_BORASS || ARITH_ASS + 11 != ARITH_EQ
2872+#error Arithmetic tokens are out of order.
2873+#endif
2874+
2875+static const char *arith_startbuf;
2876+
2877+const char *arith_buf;
2878+union yystype yylval;
2879+
2880+static int last_token;
2881+
2882+#define ARITH_PRECEDENCE(op, prec) [op - ARITH_BINOP_MIN] = prec
2883+
2884+static const char prec[ARITH_BINOP_MAX - ARITH_BINOP_MIN] = {
2885+ ARITH_PRECEDENCE(ARITH_MUL, 0),
2886+ ARITH_PRECEDENCE(ARITH_DIV, 0),
2887+ ARITH_PRECEDENCE(ARITH_REM, 0),
2888+ ARITH_PRECEDENCE(ARITH_ADD, 1),
2889+ ARITH_PRECEDENCE(ARITH_SUB, 1),
2890+ ARITH_PRECEDENCE(ARITH_LSHIFT, 2),
2891+ ARITH_PRECEDENCE(ARITH_RSHIFT, 2),
2892+ ARITH_PRECEDENCE(ARITH_LT, 3),
2893+ ARITH_PRECEDENCE(ARITH_LE, 3),
2894+ ARITH_PRECEDENCE(ARITH_GT, 3),
2895+ ARITH_PRECEDENCE(ARITH_GE, 3),
2896+ ARITH_PRECEDENCE(ARITH_EQ, 4),
2897+ ARITH_PRECEDENCE(ARITH_NE, 4),
2898+ ARITH_PRECEDENCE(ARITH_BAND, 5),
2899+ ARITH_PRECEDENCE(ARITH_BXOR, 6),
2900+ ARITH_PRECEDENCE(ARITH_BOR, 7),
2901+};
2902+
2903+static void yyerror(const char *s) __attribute__ ((noreturn));
2904+static void yyerror(const char *s)
2905+{
2906+ sh_error("arithmetic expression: %s: \"%s\"", s, arith_startbuf);
2907+ /* NOTREACHED */
2908+}
2909+
2910+static inline int higher_prec(int op1, int op2)
2911+{
2912+ return prec[op1 - ARITH_BINOP_MIN] < prec[op2 - ARITH_BINOP_MIN];
2913+}
2914+
2915+static intmax_t do_binop(int op, intmax_t a, intmax_t b)
2916+{
2917+ imaxdiv_t div;
2918+
2919+ switch (op) {
2920+ default:
2921+ case ARITH_REM:
2922+ case ARITH_DIV:
2923+ if (!b)
2924+ yyerror("division by zero");
2925+ div = imaxdiv(a, b);
2926+ return op == ARITH_REM ? div.rem : div.quot;
2927+ case ARITH_MUL:
2928+ return a * b;
2929+ case ARITH_ADD:
2930+ return a + b;
2931+ case ARITH_SUB:
2932+ return a - b;
2933+ case ARITH_LSHIFT:
2934+ return a << b;
2935+ case ARITH_RSHIFT:
2936+ return a >> b;
2937+ case ARITH_LT:
2938+ return a < b;
2939+ case ARITH_LE:
2940+ return a <= b;
2941+ case ARITH_GT:
2942+ return a > b;
2943+ case ARITH_GE:
2944+ return a >= b;
2945+ case ARITH_EQ:
2946+ return a == b;
2947+ case ARITH_NE:
2948+ return a != b;
2949+ case ARITH_BAND:
2950+ return a & b;
2951+ case ARITH_BXOR:
2952+ return a ^ b;
2953+ case ARITH_BOR:
2954+ return a | b;
2955+ }
2956+}
2957+
2958+static intmax_t assignment(int var, int noeval);
2959+
2960+static intmax_t primary(int token, union yystype *val, int op, int noeval)
2961+{
2962+ intmax_t result;
2963+
2964+again:
2965+ switch (token) {
2966+ case ARITH_LPAREN:
2967+ result = assignment(op, noeval);
2968+ if (last_token != ARITH_RPAREN)
2969+ yyerror("expecting ')'");
2970+ last_token = yylex();
2971+ return result;
2972+ case ARITH_NUM:
2973+ last_token = op;
2974+ return val->val;
2975+ case ARITH_VAR:
2976+ last_token = op;
2977+ return noeval ? val->val : lookupvarint(val->name);
2978+ case ARITH_ADD:
2979+ token = op;
2980+ *val = yylval;
2981+ op = yylex();
2982+ goto again;
2983+ case ARITH_SUB:
2984+ *val = yylval;
2985+ return -primary(op, val, yylex(), noeval);
2986+ case ARITH_NOT:
2987+ *val = yylval;
2988+ return !primary(op, val, yylex(), noeval);
2989+ case ARITH_BNOT:
2990+ *val = yylval;
2991+ return ~primary(op, val, yylex(), noeval);
2992+ default:
2993+ yyerror("expecting primary");
2994+ }
2995+}
2996+
2997+static intmax_t binop2(intmax_t a, int op, int noeval)
2998+{
2999+ for (;;) {
3000+ union yystype val;
3001+ intmax_t b;
3002+ int op2;
3003+ int token;
3004+
3005+ token = yylex();
3006+ val = yylval;
3007+
3008+ b = primary(token, &val, yylex(), noeval);
3009+
3010+ op2 = last_token;
3011+ if (op2 < ARITH_BINOP_MIN || op2 >= ARITH_BINOP_MAX)
3012+ return noeval ? b : do_binop(op, a, b);
3013+
3014+ if (higher_prec(op2, op)) {
3015+ b = binop2(b, op2, noeval);
3016+ return noeval ? b : do_binop(op, a, b);
3017+ }
3018+
3019+ a = do_binop(op, a, b);
3020+ op = op2;
3021+ }
3022+}
3023+
3024+static intmax_t binop(int token, union yystype *val, int op, int noeval)
3025+{
3026+ intmax_t a = primary(token, val, op, noeval);
3027+
3028+ op = last_token;
3029+ if (op < ARITH_BINOP_MIN || op >= ARITH_BINOP_MAX)
3030+ return a;
3031+
3032+ return binop2(a, op, noeval);
3033+}
3034+
3035+static intmax_t and(int token, union yystype *val, int op, int noeval)
3036+{
3037+ intmax_t a = binop(token, val, op, noeval);
3038+ intmax_t b;
3039+
3040+ op = last_token;
3041+ if (op != ARITH_AND)
3042+ return a;
3043+
3044+ token = yylex();
3045+ *val = yylval;
3046+
3047+ b = and(token, val, yylex(), noeval | !a);
3048+
3049+ return a && b;
3050+}
3051+
3052+static intmax_t or(int token, union yystype *val, int op, int noeval)
3053+{
3054+ intmax_t a = and(token, val, op, noeval);
3055+ intmax_t b;
3056+
3057+ op = last_token;
3058+ if (op != ARITH_OR)
3059+ return a;
3060+
3061+ token = yylex();
3062+ *val = yylval;
3063+
3064+ b = or(token, val, yylex(), noeval | !!a);
3065+
3066+ return a | b;
3067+}
3068+
3069+static intmax_t cond(int token, union yystype *val, int op, int noeval)
3070+{
3071+ intmax_t a = or(token, val, op, noeval);
3072+ intmax_t b;
3073+ intmax_t c;
3074+
3075+ if (last_token != ARITH_QMARK)
3076+ return a;
3077+
3078+ b = assignment(yylex(), noeval | !a);
3079+
3080+ if (last_token != ARITH_COLON)
3081+ yyerror("expecting ':'");
3082+
3083+ token = yylex();
3084+ *val = yylval;
3085+
3086+ c = cond(token, val, yylex(), noeval | !!a);
3087+
3088+ return a ? b : c;
3089+}
3090+
3091+static intmax_t assignment(int var, int noeval)
3092+{
3093+ union yystype val = yylval;
3094+ int op = yylex();
3095+ intmax_t result;
3096+
3097+ if (var != ARITH_VAR)
3098+ return cond(var, &val, op, noeval);
3099+
3100+ if (op != ARITH_ASS && (op < ARITH_ASS_MIN || op >= ARITH_ASS_MAX))
3101+ return cond(var, &val, op, noeval);
3102+
3103+ result = assignment(yylex(), noeval);
3104+ if (noeval)
3105+ return result;
3106+
3107+ return setvarint(val.name,
3108+ op == ARITH_ASS ? result :
3109+ do_binop(op - 11, lookupvarint(val.name), result));
3110+}
3111+
3112+intmax_t arith(const char *s)
3113+{
3114+ intmax_t result;
3115+
3116+ arith_buf = arith_startbuf = s;
3117+
3118+ result = assignment(yylex(), 0);
3119+
3120+ if (last_token)
3121+ yyerror("expecting EOF");
3122+
3123+ return result;
3124+}
3125diff --git a/src/arith_yacc.h b/src/arith_yacc.h
3126new file mode 100644
3127index 0000000..ff34d52
3128--- /dev/null
3129+++ b/src/arith_yacc.h
3130@@ -0,0 +1,89 @@
3131+/*-
3132+ * Copyright (c) 1993
3133+ * The Regents of the University of California. All rights reserved.
3134+ * Copyright (c) 2007
3135+ * Herbert Xu <herbert@gondor.apana.org.au>. All rights reserved.
3136+ *
3137+ * This code is derived from software contributed to Berkeley by
3138+ * Kenneth Almquist.
3139+ *
3140+ * Redistribution and use in source and binary forms, with or without
3141+ * modification, are permitted provided that the following conditions
3142+ * are met:
3143+ * 1. Redistributions of source code must retain the above copyright
3144+ * notice, this list of conditions and the following disclaimer.
3145+ * 2. Redistributions in binary form must reproduce the above copyright
3146+ * notice, this list of conditions and the following disclaimer in the
3147+ * documentation and/or other materials provided with the distribution.
3148+ * 3. Neither the name of the University nor the names of its contributors
3149+ * may be used to endorse or promote products derived from this software
3150+ * without specific prior written permission.
3151+ *
3152+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
3153+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
3154+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
3155+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3156+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3157+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3158+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3159+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3160+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3161+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3162+ * SUCH DAMAGE.
3163+ */
3164+
3165+#define ARITH_ASS 1
3166+
3167+#define ARITH_OR 2
3168+#define ARITH_AND 3
3169+#define ARITH_BAD 4
3170+#define ARITH_NUM 5
3171+#define ARITH_VAR 6
3172+#define ARITH_NOT 7
3173+
3174+#define ARITH_BINOP_MIN 8
3175+#define ARITH_LE 8
3176+#define ARITH_GE 9
3177+#define ARITH_LT 10
3178+#define ARITH_GT 11
3179+#define ARITH_EQ 12
3180+#define ARITH_REM 13
3181+#define ARITH_BAND 14
3182+#define ARITH_LSHIFT 15
3183+#define ARITH_RSHIFT 16
3184+#define ARITH_MUL 17
3185+#define ARITH_ADD 18
3186+#define ARITH_BOR 19
3187+#define ARITH_SUB 20
3188+#define ARITH_BXOR 21
3189+#define ARITH_DIV 22
3190+#define ARITH_NE 23
3191+#define ARITH_BINOP_MAX 24
3192+
3193+#define ARITH_ASS_MIN 24
3194+#define ARITH_REMASS 24
3195+#define ARITH_BANDASS 25
3196+#define ARITH_LSHIFTASS 26
3197+#define ARITH_RSHIFTASS 27
3198+#define ARITH_MULASS 28
3199+#define ARITH_ADDASS 29
3200+#define ARITH_BORASS 30
3201+#define ARITH_SUBASS 31
3202+#define ARITH_BXORASS 32
3203+#define ARITH_DIVASS 33
3204+#define ARITH_ASS_MAX 34
3205+
3206+#define ARITH_LPAREN 34
3207+#define ARITH_RPAREN 35
3208+#define ARITH_BNOT 36
3209+#define ARITH_QMARK 37
3210+#define ARITH_COLON 38
3211+
3212+union yystype {
3213+ intmax_t val;
3214+ char *name;
3215+};
3216+
3217+extern union yystype yylval;
3218+
3219+int yylex(void);
3220diff --git a/src/arith_yylex.c b/src/arith_yylex.c
3221index 4fa2051..0f46990 100644
3222--- a/src/arith_yylex.c
3223+++ b/src/arith_yylex.c
3224@@ -32,19 +32,28 @@
3225 * SUCH DAMAGE.
3226 */
3227
3228+#include <inttypes.h>
3229 #include <stdlib.h>
3230-#include "arith.h"
3231+#include <string.h>
3232+#include "arith_yacc.h"
3233 #include "expand.h"
3234 #include "error.h"
3235+#include "shell.h"
3236+#include "memalloc.h"
3237+#include "syntax.h"
3238
3239-extern int yylval;
3240-extern const char *arith_buf, *arith_startbuf;
3241+#if ARITH_BOR + 11 != ARITH_BORASS || ARITH_ASS + 11 != ARITH_EQ
3242+#error Arithmetic tokens are out of order.
3243+#endif
3244+
3245+extern const char *arith_buf;
3246
3247 int
3248 yylex()
3249 {
3250 int value;
3251 const char *buf = arith_buf;
3252+ const char *p;
3253
3254 for (;;) {
3255 switch (*buf) {
3256@@ -54,9 +63,7 @@ yylex()
3257 buf++;
3258 continue;
3259 default:
3260-err:
3261- sh_error("arith: syntax error: \"%s\"", arith_startbuf);
3262- /* NOTREACHED */
3263+ return ARITH_BAD;
3264 case '0':
3265 case '1':
3266 case '2':
3267@@ -67,13 +74,74 @@ err:
3268 case '7':
3269 case '8':
3270 case '9':
3271- yylval = strtoll(buf, (char **) &arith_buf, 0);
3272+ yylval.val = strtoimax(buf, (char **)&arith_buf, 0);
3273 return ARITH_NUM;
3274+ case 'A':
3275+ case 'B':
3276+ case 'C':
3277+ case 'D':
3278+ case 'E':
3279+ case 'F':
3280+ case 'G':
3281+ case 'H':
3282+ case 'I':
3283+ case 'J':
3284+ case 'K':
3285+ case 'L':
3286+ case 'M':
3287+ case 'N':
3288+ case 'O':
3289+ case 'P':
3290+ case 'Q':
3291+ case 'R':
3292+ case 'S':
3293+ case 'T':
3294+ case 'U':
3295+ case 'V':
3296+ case 'W':
3297+ case 'X':
3298+ case 'Y':
3299+ case 'Z':
3300+ case '_':
3301+ case 'a':
3302+ case 'b':
3303+ case 'c':
3304+ case 'd':
3305+ case 'e':
3306+ case 'f':
3307+ case 'g':
3308+ case 'h':
3309+ case 'i':
3310+ case 'j':
3311+ case 'k':
3312+ case 'l':
3313+ case 'm':
3314+ case 'n':
3315+ case 'o':
3316+ case 'p':
3317+ case 'q':
3318+ case 'r':
3319+ case 's':
3320+ case 't':
3321+ case 'u':
3322+ case 'v':
3323+ case 'w':
3324+ case 'x':
3325+ case 'y':
3326+ case 'z':
3327+ p = buf;
3328+ while (buf++, is_in_name(*buf))
3329+ ;
3330+ yylval.name = stalloc(buf - p + 1);
3331+ *(char *)mempcpy(yylval.name, p, buf - p) = 0;
3332+ value = ARITH_VAR;
3333+ goto out;
3334 case '=':
3335- if (*++buf != '=') {
3336- goto err;
3337- }
3338- value = ARITH_EQ;
3339+ value = ARITH_ASS;
3340+checkeq:
3341+ if (*++buf != '=')
3342+ goto out;
3343+ value += 11;
3344 break;
3345 case '>':
3346 switch (*++buf) {
3347@@ -82,7 +150,7 @@ err:
3348 break;
3349 case '>':
3350 value = ARITH_RSHIFT;
3351- break;
3352+ goto checkeq;
3353 default:
3354 value = ARITH_GT;
3355 goto out;
3356@@ -95,7 +163,7 @@ err:
3357 break;
3358 case '<':
3359 value = ARITH_LSHIFT;
3360- break;
3361+ goto checkeq;
3362 default:
3363 value = ARITH_LT;
3364 goto out;
3365@@ -104,14 +172,14 @@ err:
3366 case '|':
3367 if (*++buf != '|') {
3368 value = ARITH_BOR;
3369- goto out;
3370+ goto checkeq;
3371 }
3372 value = ARITH_OR;
3373 break;
3374 case '&':
3375 if (*++buf != '&') {
3376 value = ARITH_BAND;
3377- goto out;
3378+ goto checkeq;
3379 }
3380 value = ARITH_AND;
3381 break;
3382@@ -133,24 +201,30 @@ err:
3383 break;
3384 case '*':
3385 value = ARITH_MUL;
3386- break;
3387+ goto checkeq;
3388 case '/':
3389 value = ARITH_DIV;
3390- break;
3391+ goto checkeq;
3392 case '%':
3393 value = ARITH_REM;
3394- break;
3395+ goto checkeq;
3396 case '+':
3397 value = ARITH_ADD;
3398- break;
3399+ goto checkeq;
3400 case '-':
3401 value = ARITH_SUB;
3402- break;
3403+ goto checkeq;
3404 case '~':
3405 value = ARITH_BNOT;
3406 break;
3407 case '^':
3408 value = ARITH_BXOR;
3409+ goto checkeq;
3410+ case '?':
3411+ value = ARITH_QMARK;
3412+ break;
3413+ case ':':
3414+ value = ARITH_COLON;
3415 break;
3416 }
3417 break;
3418diff --git a/src/expand.c b/src/expand.c
3419index 54fe908..9cb8eab 100644
3420--- a/src/expand.c
3421+++ b/src/expand.c
3422@@ -42,6 +42,7 @@
3423 #endif
3424 #include <stdlib.h>
3425 #include <stdio.h>
3426+#include <stdint.h>
3427 #include <limits.h>
3428 #include <string.h>
3429 #if defined(__GLIBC__)
3430@@ -142,7 +143,7 @@ STATIC int pmatch(const char *, const char *);
3431 #else
3432 #define pmatch(a, b) !fnmatch((a), (b), 0)
3433 #endif
3434-STATIC int cvtnum(long);
3435+STATIC int cvtnum(intmax_t);
3436 STATIC size_t esclen(const char *, const char *);
3437 STATIC char *scanleft(char *, char *, char *, char *, int, int);
3438 STATIC char *scanright(char *, char *, char *, char *, int, int);
3439@@ -478,9 +479,11 @@ removerecordregions(int endoff)
3440 void
3441 expari(int flag)
3442 {
3443+ struct stackmark sm;
3444 char *p, *start;
3445 int begoff;
3446 int len;
3447+ intmax_t result;
3448
3449 /* ifsfree(); */
3450
3451@@ -490,8 +493,9 @@ expari(int flag)
3452 * start of arithmetic.
3453 */
3454 start = stackblock();
3455- p = expdest - 1;
3456- *p = '\0';
3457+ p = expdest;
3458+ pushstackmark(&sm, p - start);
3459+ *--p = '\0';
3460 p--;
3461 do {
3462 int esc;
3463@@ -522,7 +526,10 @@ expari(int flag)
3464 if (flag & QUOTES_ESC)
3465 rmescapes(p + 1);
3466
3467- len = cvtnum(arith(p + 1));
3468+ result = arith(p + 1);
3469+ popstackmark(&sm);
3470+
3471+ len = cvtnum(result);
3472
3473 if (!(flag & EXP_QUOTED))
3474 recordregion(begoff, begoff + len, 0);
3475@@ -1707,12 +1714,12 @@ casematch(union node *pattern, char *val)
3476 */
3477
3478 STATIC int
3479-cvtnum(long num)
3480+cvtnum(intmax_t num)
3481 {
3482- int len;
3483+ int len = max_int_length(sizeof(num));
3484
3485- expdest = makestrspace(32, expdest);
3486- len = fmtstr(expdest, 32, "%ld", num);
3487+ expdest = makestrspace(len, expdest);
3488+ len = fmtstr(expdest, len, "%jd", num);
3489 STADJUST(len, expdest);
3490 return len;
3491 }
3492diff --git a/src/expand.h b/src/expand.h
3493index 4dfbc43..225b004 100644
3494--- a/src/expand.h
3495+++ b/src/expand.h
3496@@ -34,6 +34,8 @@
3497 * @(#)expand.h 8.2 (Berkeley) 5/4/95
3498 */
3499
3500+#include <stdint.h>
3501+
3502 struct strlist {
3503 struct strlist *next;
3504 char *text;
3505@@ -68,7 +70,7 @@ char *_rmescapes(char *, int);
3506 int casematch(union node *, char *);
3507
3508 /* From arith.y */
3509-int arith(const char *);
3510+intmax_t arith(const char *);
3511 int expcmd(int , char **);
3512 #ifdef USE_LEX
3513 void arith_lex_reset(void);
3514diff --git a/src/mystring.c b/src/mystring.c
3515index df1691b..b84b7e2 100644
3516--- a/src/mystring.c
3517+++ b/src/mystring.c
3518@@ -112,13 +112,13 @@ prefix(const char *string, const char *pfx)
3519 /*
3520 * Convert a string into an integer of type intmax_t. Alow trailing spaces.
3521 */
3522-intmax_t atomax10(const char *s)
3523+intmax_t atomax(const char *s, int base)
3524 {
3525 char *p;
3526 intmax_t r;
3527
3528 errno = 0;
3529- r = strtoimax(s, &p, 10);
3530+ r = strtoimax(s, &p, base);
3531
3532 if (errno != 0)
3533 sh_error(illnum, s);
3534@@ -132,6 +132,11 @@ intmax_t atomax10(const char *s)
3535 return r;
3536 }
3537
3538+intmax_t atomax10(const char *s)
3539+{
3540+ return atomax(s, 10);
3541+}
3542+
3543 /*
3544 * Convert a string of digits to an integer, printing an error message on
3545 * failure.
3546diff --git a/src/mystring.h b/src/mystring.h
3547index c9cade6..477cd16 100644
3548--- a/src/mystring.h
3549+++ b/src/mystring.h
3550@@ -48,6 +48,7 @@ extern const char homestr[];
3551 void scopyn(const char *, char *, int);
3552 #endif
3553 char *prefix(const char *, const char *);
3554+intmax_t atomax(const char *, int);
3555 intmax_t atomax10(const char *);
3556 int number(const char *);
3557 int is_number(const char *);
3558diff --git a/src/shell.h b/src/shell.h
3559index 9b67696..98edc8b 100644
3560--- a/src/shell.h
3561+++ b/src/shell.h
3562@@ -92,3 +92,13 @@ extern char nullstr[1]; /* null string */
3563
3564 #define likely(x) __builtin_expect(!!(x),1)
3565 #define unlikely(x) __builtin_expect(!!(x),0)
3566+
3567+/*
3568+ * Hack to calculate maximum length.
3569+ * (length * 8 - 1) * log10(2) + 1 + 1 + 12
3570+ * The second 1 is for the minus sign and the 12 is a safety margin.
3571+ */
3572+static inline int max_int_length(int bytes)
3573+{
3574+ return (bytes * 8 - 1) * 0.30102999566398119521 + 14;
3575+}
3576diff --git a/src/var.c b/src/var.c
3577index 501a279..17d3637 100644
3578--- a/src/var.c
3579+++ b/src/var.c
3580@@ -202,6 +202,21 @@ setvar(const char *name, const char *val, int flags)
3581 INTON;
3582 }
3583
3584+/*
3585+ * Set the given integer as the value of a variable. The flags argument is
3586+ * ored with the flags of the variable.
3587+ */
3588+
3589+intmax_t setvarint(const char *name, intmax_t val)
3590+{
3591+ int len = max_int_length(sizeof(val));
3592+ char buf[len];
3593+
3594+ fmtstr(buf, len, "%jd", val);
3595+ setvar(name, buf, 0);
3596+ return val;
3597+}
3598+
3599
3600
3601 /*
3602@@ -293,6 +308,11 @@ lookupvar(const char *name)
3603 return NULL;
3604 }
3605
3606+intmax_t lookupvarint(const char *name)
3607+{
3608+ return atomax(lookupvar(name) ?: nullstr, 0);
3609+}
3610+
3611
3612
3613 /*
3614diff --git a/src/var.h b/src/var.h
3615index ae58c6c..66443df 100644
3616--- a/src/var.h
3617+++ b/src/var.h
3618@@ -34,6 +34,8 @@
3619 * @(#)var.h 8.2 (Berkeley) 5/4/95
3620 */
3621
3622+#include <stdint.h>
3623+
3624 /*
3625 * Shell variables.
3626 */
3627@@ -125,10 +127,12 @@ extern const char defpathvar[];
3628
3629 void initvar(void);
3630 void setvar(const char *, const char *, int);
3631+intmax_t setvarint(const char *, intmax_t);
3632 void setvareq(char *, int);
3633 struct strlist;
3634 void listsetvar(struct strlist *, int);
3635 char *lookupvar(const char *);
3636+intmax_t lookupvarint(const char *);
3637 char *bltinlookup(const char *);
3638 char **listvars(int, int, char ***);
3639 #define environment() listvars(VEXPORT, VUNSET, 0)
3640--
36411.5.5
3642
3643From 7501b55f699ab71fc6cd2667716e70eebaa2868a Mon Sep 17 00:00:00 2001
3644From: Herbert Xu <herbert@gondor.apana.org.au>
3645Date: Thu, 11 Oct 2007 22:38:46 +0800
3646Subject: [PATCH] [ARITH] Size optimisations in arithmetic lexer
3647
3648Use += instead of straight assignment for token value.
3649---
3650 ChangeLog | 1 +
3651 src/arith_yylex.c | 52 ++++++++++++++++++++++++++--------------------------
3652 2 files changed, 27 insertions(+), 26 deletions(-)
3653
3654diff --git a/ChangeLog b/ChangeLog
3655index 895c607..1f26b83 100644
3656--- a/ChangeLog
3657+++ b/ChangeLog
3658@@ -1,6 +1,7 @@
3659 2007-10-11 Herbert Xu <herbert@gondor.apana.org.au>
3660
3661 * Add assignment support in arithmetic expansions.
3662+ * Size optimisations in arithmetic lexer.
3663
3664 2007-10-08 Herbert Xu <herbert@gondor.apana.org.au>
3665
3666diff --git a/src/arith_yylex.c b/src/arith_yylex.c
3667index 0f46990..2c15657 100644
3668--- a/src/arith_yylex.c
3669+++ b/src/arith_yylex.c
3670@@ -56,7 +56,8 @@ yylex()
3671 const char *p;
3672
3673 for (;;) {
3674- switch (*buf) {
3675+ value = *buf;
3676+ switch (value) {
3677 case ' ':
3678 case '\t':
3679 case '\n':
3680@@ -137,7 +138,7 @@ yylex()
3681 value = ARITH_VAR;
3682 goto out;
3683 case '=':
3684- value = ARITH_ASS;
3685+ value += ARITH_ASS - '=';
3686 checkeq:
3687 if (*++buf != '=')
3688 goto out;
3689@@ -146,85 +147,84 @@ checkeq:
3690 case '>':
3691 switch (*++buf) {
3692 case '=':
3693- value = ARITH_GE;
3694+ value += ARITH_GE - '>';
3695 break;
3696 case '>':
3697- value = ARITH_RSHIFT;
3698+ value += ARITH_RSHIFT - '>';
3699 goto checkeq;
3700 default:
3701- value = ARITH_GT;
3702+ value += ARITH_GT - '>';
3703 goto out;
3704 }
3705 break;
3706 case '<':
3707 switch (*++buf) {
3708 case '=':
3709- value = ARITH_LE;
3710+ value += ARITH_LE - '<';
3711 break;
3712 case '<':
3713- value = ARITH_LSHIFT;
3714+ value += ARITH_LSHIFT - '<';
3715 goto checkeq;
3716 default:
3717- value = ARITH_LT;
3718+ value += ARITH_LT - '<';
3719 goto out;
3720 }
3721 break;
3722 case '|':
3723 if (*++buf != '|') {
3724- value = ARITH_BOR;
3725+ value += ARITH_BOR - '|';
3726 goto checkeq;
3727 }
3728- value = ARITH_OR;
3729+ value += ARITH_OR - '|';
3730 break;
3731 case '&':
3732 if (*++buf != '&') {
3733- value = ARITH_BAND;
3734+ value += ARITH_BAND - '&';
3735 goto checkeq;
3736 }
3737- value = ARITH_AND;
3738+ value += ARITH_AND - '&';
3739 break;
3740 case '!':
3741 if (*++buf != '=') {
3742- value = ARITH_NOT;
3743+ value += ARITH_NOT - '!';
3744 goto out;
3745 }
3746- value = ARITH_NE;
3747+ value += ARITH_NE - '!';
3748 break;
3749 case 0:
3750- value = 0;
3751 goto out;
3752 case '(':
3753- value = ARITH_LPAREN;
3754+ value += ARITH_LPAREN - '(';
3755 break;
3756 case ')':
3757- value = ARITH_RPAREN;
3758+ value += ARITH_RPAREN - ')';
3759 break;
3760 case '*':
3761- value = ARITH_MUL;
3762+ value += ARITH_MUL - '*';
3763 goto checkeq;
3764 case '/':
3765- value = ARITH_DIV;
3766+ value += ARITH_DIV - '/';
3767 goto checkeq;
3768 case '%':
3769- value = ARITH_REM;
3770+ value += ARITH_REM - '%';
3771 goto checkeq;
3772 case '+':
3773- value = ARITH_ADD;
3774+ value += ARITH_ADD - '+';
3775 goto checkeq;
3776 case '-':
3777- value = ARITH_SUB;
3778+ value += ARITH_SUB - '-';
3779 goto checkeq;
3780 case '~':
3781- value = ARITH_BNOT;
3782+ value += ARITH_BNOT - '~';
3783 break;
3784 case '^':
3785- value = ARITH_BXOR;
3786+ value += ARITH_BXOR - '^';
3787 goto checkeq;
3788 case '?':
3789- value = ARITH_QMARK;
3790+ value += ARITH_QMARK - '?';
3791 break;
3792 case ':':
3793- value = ARITH_COLON;
3794+ value += ARITH_COLON - ':';
3795 break;
3796 }
3797 break;
3798--
37991.5.5
3800
3801From cb854af0a92e82e4640df0a8152280b9c9628da8 Mon Sep 17 00:00:00 2001
3802From: Herbert Xu <herbert@gondor.apana.org.au>
3803Date: Thu, 11 Oct 2007 22:42:04 +0800
3804Subject: [PATCH] [EXPAND] Add likely flags in expari
3805
3806The case where the expansion isn't quoted is the norm.
3807---
3808 ChangeLog | 1 +
3809 src/expand.c | 4 ++--
3810 2 files changed, 3 insertions(+), 2 deletions(-)
3811
3812diff --git a/ChangeLog b/ChangeLog
3813index 1f26b83..98c546e 100644
3814--- a/ChangeLog
3815+++ b/ChangeLog
3816@@ -2,6 +2,7 @@
3817
3818 * Add assignment support in arithmetic expansions.
3819 * Size optimisations in arithmetic lexer.
3820+ * Add likely flags in expari.
3821
3822 2007-10-08 Herbert Xu <herbert@gondor.apana.org.au>
3823
3824diff --git a/src/expand.c b/src/expand.c
3825index 9cb8eab..5c31400 100644
3826--- a/src/expand.c
3827+++ b/src/expand.c
3828@@ -523,7 +523,7 @@ expari(int flag)
3829
3830 expdest = p;
3831
3832- if (flag & QUOTES_ESC)
3833+ if (likely(flag & QUOTES_ESC))
3834 rmescapes(p + 1);
3835
3836 result = arith(p + 1);
3837@@ -531,7 +531,7 @@ expari(int flag)
3838
3839 len = cvtnum(result);
3840
3841- if (!(flag & EXP_QUOTED))
3842+ if (likely(!(flag & EXP_QUOTED)))
3843 recordregion(begoff, begoff + len, 0);
3844 }
3845
3846--
38471.5.5
3848
3849From 894c375d54ef5c0d90523d9aa06ec183e5894122 Mon Sep 17 00:00:00 2001
3850From: Herbert Xu <herbert@gondor.apana.org.au>
3851Date: Thu, 11 Oct 2007 22:44:40 +0800
3852Subject: [PATCH] [BUILTIN] Use setvarint to set OPTIND
3853
3854This patch adds a flag argument to setvarint and uses it to set the OPTIND
3855variable.
3856---
3857 ChangeLog | 1 +
3858 src/arith_yacc.c | 2 +-
3859 src/options.c | 5 ++---
3860 src/var.c | 4 ++--
3861 src/var.h | 2 +-
3862 5 files changed, 7 insertions(+), 7 deletions(-)
3863
3864diff --git a/ChangeLog b/ChangeLog
3865index 98c546e..00c09c3 100644
3866--- a/ChangeLog
3867+++ b/ChangeLog
3868@@ -3,6 +3,7 @@
3869 * Add assignment support in arithmetic expansions.
3870 * Size optimisations in arithmetic lexer.
3871 * Add likely flags in expari.
3872+ * Use setvarint to set OPTIND.
3873
3874 2007-10-08 Herbert Xu <herbert@gondor.apana.org.au>
3875
3876diff --git a/src/arith_yacc.c b/src/arith_yacc.c
3877index ad653ed..e473594 100644
3878--- a/src/arith_yacc.c
3879+++ b/src/arith_yacc.c
3880@@ -280,7 +280,7 @@ static intmax_t assignment(int var, int noeval)
3881
3882 return setvarint(val.name,
3883 op == ARITH_ASS ? result :
3884- do_binop(op - 11, lookupvarint(val.name), result));
3885+ do_binop(op - 11, lookupvarint(val.name), result), 0);
3886 }
3887
3888 intmax_t arith(const char *s)
3889diff --git a/src/options.c b/src/options.c
3890index 568148a..f669117 100644
3891--- a/src/options.c
3892+++ b/src/options.c
3893@@ -419,7 +419,7 @@ getopts(char *optstr, char *optvar, char **optfirst)
3894 char *p, *q;
3895 char c = '?';
3896 int done = 0;
3897- char s[12];
3898+ char s[2];
3899 char **optnext;
3900 int ind = shellparam.optind;
3901 int off = shellparam.optoff;
3902@@ -487,8 +487,7 @@ atend:
3903
3904 out:
3905 ind = optnext - optfirst + 1;
3906- fmtstr(s, sizeof(s), "%d", ind);
3907- setvar("OPTIND", s, VNOFUNC);
3908+ setvarint("OPTIND", ind, VNOFUNC);
3909 s[0] = c;
3910 s[1] = '\0';
3911 setvar(optvar, s, 0);
3912diff --git a/src/var.c b/src/var.c
3913index 17d3637..7f9af9c 100644
3914--- a/src/var.c
3915+++ b/src/var.c
3916@@ -207,13 +207,13 @@ setvar(const char *name, const char *val, int flags)
3917 * ored with the flags of the variable.
3918 */
3919
3920-intmax_t setvarint(const char *name, intmax_t val)
3921+intmax_t setvarint(const char *name, intmax_t val, int flags)
3922 {
3923 int len = max_int_length(sizeof(val));
3924 char buf[len];
3925
3926 fmtstr(buf, len, "%jd", val);
3927- setvar(name, buf, 0);
3928+ setvar(name, buf, flags);
3929 return val;
3930 }
3931
3932diff --git a/src/var.h b/src/var.h
3933index 66443df..e4e2cff 100644
3934--- a/src/var.h
3935+++ b/src/var.h
3936@@ -127,7 +127,7 @@ extern const char defpathvar[];
3937
3938 void initvar(void);
3939 void setvar(const char *, const char *, int);
3940-intmax_t setvarint(const char *, intmax_t);
3941+intmax_t setvarint(const char *, intmax_t, int);
3942 void setvareq(char *, int);
3943 struct strlist;
3944 void listsetvar(struct strlist *, int);
3945--
39461.5.5
3947
3948From cbf7553964832984f17c0c16ff071970e19a45c2 Mon Sep 17 00:00:00 2001
3949From: Herbert Xu <herbert@gondor.apana.org.au>
3950Date: Mon, 15 Oct 2007 20:24:28 +0800
3951Subject: [PATCH] [EXEC] Fixed execing of scripts with no hash-bang
3952
3953The function tryexec used the original name instead of the path found through
3954PATH search. This patch fixes that.
3955
3956Test case:
3957
3958 trap 'rm -f $TMP' EXIT
3959 TMP=$(tempfile -s nosuchthing)
3960
3961 cat <<- EOF > $TMP
3962 echo OK
3963 EOF
3964 chmod u+x $TMP
3965
3966 cd /
3967 PATH=${TMP%/*} ${TMP##*/}
3968
3969Old result:
3970
3971 /bin/sh: Can't open filelgY4Fanosuchthing
3972
3973New result:
3974
3975 OK
3976---
3977 ChangeLog | 4 ++++
3978 src/eval.c | 3 ++-
3979 src/exec.c | 21 +++------------------
3980 3 files changed, 9 insertions(+), 19 deletions(-)
3981
3982diff --git a/ChangeLog b/ChangeLog
3983index 00c09c3..60bdfb5 100644
3984--- a/ChangeLog
3985+++ b/ChangeLog
3986@@ -1,3 +1,7 @@
3987+2007-10-15 Herbert Xu <herbert@gondor.apana.org.au>
3988+
3989+ * Fixed execing of scripts with no hash-bang.
3990+
3991 2007-10-11 Herbert Xu <herbert@gondor.apana.org.au>
3992
3993 * Add assignment support in arithmetic expansions.
3994diff --git a/src/eval.c b/src/eval.c
3995index 2aa8317..1e0edd9 100644
3996--- a/src/eval.c
3997+++ b/src/eval.c
3998@@ -727,7 +727,8 @@ evalcommand(union node *cmd, int flags)
3999 argc++;
4000 }
4001
4002- argv = nargv = stalloc(sizeof (char *) * (argc + 1));
4003+ /* Reserve one extra spot at the front for shellexec. */
4004+ argv = nargv = stalloc(sizeof (char *) * (argc + 2)) + 1;
4005 for (sp = arglist.list ; sp ; sp = sp->next) {
4006 TRACE(("evalcommand arg: %s\n", sp->text));
4007 *nargv++ = sp->text;
4008diff --git a/src/exec.c b/src/exec.c
4009index 8a1f722..bbb70e8 100644
4010--- a/src/exec.c
4011+++ b/src/exec.c
4012@@ -149,11 +149,6 @@ shellexec(char **argv, const char *path, int idx)
4013 STATIC void
4014 tryexec(char *cmd, char **argv, char **envp)
4015 {
4016- int repeated = 0;
4017-#if !defined(BSD) && !defined(linux)
4018- char *p;
4019-#endif
4020-
4021 repeat:
4022 #ifdef SYSV
4023 do {
4024@@ -162,19 +157,9 @@ repeat:
4025 #else
4026 execve(cmd, argv, envp);
4027 #endif
4028- if (repeated++) {
4029- ckfree(argv);
4030- } else if (errno == ENOEXEC) {
4031- char **ap;
4032- char **new;
4033-
4034- for (ap = argv; *ap; ap++)
4035- ;
4036- ap = new = ckmalloc((ap - argv + 2) * sizeof(char *));
4037- *ap++ = cmd = _PATH_BSHELL;
4038- while ((*ap++ = *argv++))
4039- ;
4040- argv = new;
4041+ if (cmd != _PATH_BSHELL && errno == ENOEXEC) {
4042+ *argv-- = cmd;
4043+ *argv = cmd = _PATH_BSHELL;
4044 goto repeat;
4045 }
4046 }
4047--
40481.5.5
4049
4050From 63a0dd11d73e7b716a95373aa159f0faab557cb2 Mon Sep 17 00:00:00 2001
4051From: Oleg Verych <olecom@flower.upol.cz>
4052Date: Wed, 17 Oct 2007 12:34:03 +0800
4053Subject: [PATCH] [BUILTIN] Disallow completely blank strings in non-arithmetic context.
4054
4055* NULL as a number argument:
4056
4057olecom@deen:/mnt/debian/src/dash-0.5.3$ time src/dash tst-01.sh
4058test: 20: `': bad number
4059`' eq 0: 2 must be >1, Not A Number
4060test: 20: `': bad number
4061`' ne 0: 2 must be >1, Not A Number
4062test: 20: `': bad number
4063`' gt 0: 2 must be >1, Not A Number
4064test: 20: `': bad number
4065`' ge 0: 2 must be >1, Not A Number
4066test: 20: `': bad number
4067`' lt 0: 2 must be >1, Not A Number
4068test: 20: `': bad number
4069`' le 0: 2 must be >1, Not A Number
4070/usr/bin/test: invalid integer `'
4071`' eq 0: 2 must be >1, Not A Number
4072/usr/bin/test: invalid integer `'
4073`' ne 0: 2 must be >1, Not A Number
4074/usr/bin/test: invalid integer `'
4075`' gt 0: 2 must be >1, Not A Number
4076/usr/bin/test: invalid integer `'
4077`' ge 0: 2 must be >1, Not A Number
4078/usr/bin/test: invalid integer `'
4079`' lt 0: 2 must be >1, Not A Number
4080/usr/bin/test: invalid integer `'
4081`' le 0: 2 must be >1, Not A Number
4082
4083#!/usr/bin/printf This not executable script%c\n
4084
4085test_arithm() {
4086 for aop in eq ne gt ge lt le
4087 do "$1" 0 -$aop "$NOTHING"
4088 echo "\`' $aop 0:" $? " must be >1, Not A Number"
4089 done
4090}
4091# opengroup.org/onlinepubs/000095399/utilites/test.html (nothing about long):
4092test_arithm test
4093test_arithm /usr/bin/test
4094
4095# shend
4096---
4097 ChangeLog | 4 ++++
4098 src/mystring.c | 7 +++++++
4099 2 files changed, 11 insertions(+), 0 deletions(-)
4100
4101diff --git a/ChangeLog b/ChangeLog
4102index 60bdfb5..47a4bb0 100644
4103--- a/ChangeLog
4104+++ b/ChangeLog
4105@@ -1,3 +1,7 @@
4106+2007-10-17 Oleg Verych <olecom@flower.upol.cz>
4107+
4108+ * Disallow completely blank strings in non-arithmetic context.
4109+
4110 2007-10-15 Herbert Xu <herbert@gondor.apana.org.au>
4111
4112 * Fixed execing of scripts with no hash-bang.
4113diff --git a/src/mystring.c b/src/mystring.c
4114index b84b7e2..8e1200a 100644
4115--- a/src/mystring.c
4116+++ b/src/mystring.c
4117@@ -123,6 +123,13 @@ intmax_t atomax(const char *s, int base)
4118 if (errno != 0)
4119 sh_error(illnum, s);
4120
4121+ /*
4122+ * Disallow completely blank strings in non-arithmetic (base != 0)
4123+ * contexts.
4124+ */
4125+ if (base && (p == s))
4126+ sh_error(illnum, s);
4127+
4128 while (isspace((unsigned char)*p))
4129 p++;
4130
4131--
41321.5.5
4133
4134From 044393f703ffb1b87b207ad66869d3ebb9e09eaa Mon Sep 17 00:00:00 2001
4135From: Herbert Xu <herbert@gondor.apana.org.au>
4136Date: Wed, 17 Oct 2007 12:51:08 +0800
4137Subject: [PATCH] [SHELL] Replace shared illnum message by badnum function.
4138
4139This patch adds the badnum function and uses it to mostly replace the use
4140of illnum except in miscbltin where the current code turns out to be smaller
4141because of the twin sh_error calls.
4142---
4143 ChangeLog | 4 ++++
4144 src/eval.c | 2 +-
4145 src/mystring.c | 14 +++++++++-----
4146 src/mystring.h | 1 +
4147 4 files changed, 15 insertions(+), 6 deletions(-)
4148
4149diff --git a/ChangeLog b/ChangeLog
4150index 47a4bb0..ba9d5d5 100644
4151--- a/ChangeLog
4152+++ b/ChangeLog
4153@@ -1,3 +1,7 @@
4154+2007-10-15 Herbert Xu <herbert@gondor.apana.org.au>
4155+
4156+ * Replace shared illnum message by badnum function.
4157+
4158 2007-10-17 Oleg Verych <olecom@flower.upol.cz>
4159
4160 * Disallow completely blank strings in non-arithmetic context.
4161diff --git a/src/eval.c b/src/eval.c
4162index 1e0edd9..17b558d 100644
4163--- a/src/eval.c
4164+++ b/src/eval.c
4165@@ -1028,7 +1028,7 @@ breakcmd(int argc, char **argv)
4166 int n = argc > 1 ? number(argv[1]) : 1;
4167
4168 if (n <= 0)
4169- sh_error(illnum, argv[1]);
4170+ badnum(argv[1]);
4171 if (n > loopnest)
4172 n = loopnest;
4173 if (n > 0) {
4174diff --git a/src/mystring.c b/src/mystring.c
4175index 8e1200a..ce48c82 100644
4176--- a/src/mystring.c
4177+++ b/src/mystring.c
4178@@ -108,6 +108,10 @@ prefix(const char *string, const char *pfx)
4179 return (char *) string;
4180 }
4181
4182+void badnum(const char *s)
4183+{
4184+ sh_error(illnum, s);
4185+}
4186
4187 /*
4188 * Convert a string into an integer of type intmax_t. Alow trailing spaces.
4189@@ -121,20 +125,20 @@ intmax_t atomax(const char *s, int base)
4190 r = strtoimax(s, &p, base);
4191
4192 if (errno != 0)
4193- sh_error(illnum, s);
4194+ badnum(s);
4195
4196 /*
4197 * Disallow completely blank strings in non-arithmetic (base != 0)
4198 * contexts.
4199 */
4200- if (base && (p == s))
4201- sh_error(illnum, s);
4202+ if (p == s && base)
4203+ badnum(s);
4204
4205 while (isspace((unsigned char)*p))
4206 p++;
4207
4208 if (*p)
4209- sh_error(illnum, s);
4210+ badnum(s);
4211
4212 return r;
4213 }
4214@@ -155,7 +159,7 @@ number(const char *s)
4215 intmax_t n = atomax10(s);
4216
4217 if (n < 0 || n > INT_MAX)
4218- sh_error(illnum, s);
4219+ badnum(s);
4220
4221 return n;
4222 }
4223diff --git a/src/mystring.h b/src/mystring.h
4224index 477cd16..2e0540a 100644
4225--- a/src/mystring.h
4226+++ b/src/mystring.h
4227@@ -48,6 +48,7 @@ extern const char homestr[];
4228 void scopyn(const char *, char *, int);
4229 #endif
4230 char *prefix(const char *, const char *);
4231+void badnum(const char *s) __attribute__ ((noreturn));
4232 intmax_t atomax(const char *, int);
4233 intmax_t atomax10(const char *);
4234 int number(const char *);
4235--
42361.5.5
4237
4238From 0db88ff47ad488680bce86defd7254f4f682e850 Mon Sep 17 00:00:00 2001
4239From: Herbert Xu <herbert@gondor.apana.org.au>
4240Date: Sat, 20 Oct 2007 18:26:23 +0800
4241Subject: [PATCH] [EXPAND] Added configure --enable-glob and --enable-fnmatch options
4242
4243Debian's libc6 as of 2.6.1-6 has working glob(3)/fnmatch(3) support.
4244This patch adds the options --enable-glob and --enable-fnmatch to
4245the configure script. By default glob(3) and fnmatch(3) are still
4246unused. However, on distros where the glibc is known to work you
4247may enable these options.
4248---
4249 ChangeLog | 6 +++++-
4250 configure.ac | 13 +++++++++++++
4251 src/Makefile.am | 2 +-
4252 src/expand.c | 25 ++++++++-----------------
4253 4 files changed, 27 insertions(+), 19 deletions(-)
4254
4255diff --git a/ChangeLog b/ChangeLog
4256index ba9d5d5..a821c32 100644
4257--- a/ChangeLog
4258+++ b/ChangeLog
4259@@ -1,4 +1,8 @@
4260-2007-10-15 Herbert Xu <herbert@gondor.apana.org.au>
4261+2007-10-20 Herbert Xu <herbert@gondor.apana.org.au>
4262+
4263+ * Added configure --enable-glob and --enable-fnmatch options.
4264+
4265+2007-10-17 Herbert Xu <herbert@gondor.apana.org.au>
4266
4267 * Replace shared illnum message by badnum function.
4268
4269diff --git a/configure.ac b/configure.ac
4270index 5e8f17d..ccc4ac1 100644
4271--- a/configure.ac
4272+++ b/configure.ac
4273@@ -24,6 +24,10 @@ if test "$enable_static" = "yes"; then
4274 export LDFLAGS="-static -Wl,--fatal-warnings"
4275 fi
4276
4277+AC_ARG_ENABLE(fnmatch, AS_HELP_STRING(--enable-fnmatch, \
4278+ [Use fnmatch(3) from libc]))
4279+AC_ARG_ENABLE(glob, AS_HELP_STRING(--enable-glob, [Use glob(3) from libc]))
4280+
4281 dnl Checks for libraries.
4282
4283 dnl Checks for header files.
4284@@ -32,6 +36,15 @@ dnl Checks for library functions.
4285 AC_CHECK_FUNCS(bsearch getpwnam getrlimit isalpha killpg mempcpy sigsetmask \
4286 stpcpy strchrnul strsignal strtod strtoimax strtoumax sysconf)
4287
4288+if test "$enable_fnmatch" = yes; then
4289+ use_fnmatch=
4290+ AC_CHECK_FUNCS(fnmatch, use_fnmatch=yes)
4291+fi
4292+
4293+if test "$use_fnmatch" = yes && test "$enable_glob" = yes; then
4294+ AC_CHECK_FUNCS(glob)
4295+fi
4296+
4297 dnl Check for klibc signal.
4298 AC_CHECK_FUNC(signal)
4299 if test "$ac_cv_func_signal" != yes; then
4300diff --git a/src/Makefile.am b/src/Makefile.am
4301index 49026a3..e9130eb 100644
4302--- a/src/Makefile.am
4303+++ b/src/Makefile.am
4304@@ -4,7 +4,7 @@ COMMON_CFLAGS = -Wall
4305 COMMON_CPPFLAGS = \
4306 -include $(top_builddir)/config.h \
4307 -DBSD=1 -DSHELL \
4308- -DGLOB_BROKEN -DFNMATCH_BROKEN -DIFS_BROKEN
4309+ -DIFS_BROKEN
4310
4311 AM_CFLAGS = $(COMMON_CFLAGS)
4312 AM_CPPFLAGS = $(COMMON_CPPFLAGS)
4313diff --git a/src/expand.c b/src/expand.c
4314index 5c31400..c489446 100644
4315--- a/src/expand.c
4316+++ b/src/expand.c
4317@@ -45,16 +45,9 @@
4318 #include <stdint.h>
4319 #include <limits.h>
4320 #include <string.h>
4321-#if defined(__GLIBC__)
4322-#if !defined(FNMATCH_BROKEN)
4323 #include <fnmatch.h>
4324-#if !defined(GLOB_BROKEN)
4325 #include <glob.h>
4326-#endif
4327-#else
4328 #include <ctype.h>
4329-#endif
4330-#endif
4331
4332 /*
4333 * Routines to expand arguments to commands. We have to deal with
4334@@ -127,18 +120,16 @@ STATIC void removerecordregions(int);
4335 STATIC void ifsbreakup(char *, struct arglist *);
4336 STATIC void ifsfree(void);
4337 STATIC void expandmeta(struct strlist *, int);
4338-#if defined(__GLIBC__) && !defined(FNMATCH_BROKEN) && !defined(GLOB_BROKEN)
4339+#ifdef HAVE_GLOB
4340 STATIC void addglob(const glob_t *);
4341 #else
4342 STATIC void expmeta(char *, char *);
4343-#endif
4344-STATIC void addfname(char *);
4345-#if !(defined(__GLIBC__) && !defined(FNMATCH_BROKEN) && !defined(GLOB_BROKEN))
4346 STATIC struct strlist *expsort(struct strlist *);
4347 STATIC struct strlist *msort(struct strlist *, int);
4348 #endif
4349+STATIC void addfname(char *);
4350 STATIC int patmatch(char *, const char *);
4351-#if !defined(__GLIBC__) || defined(FNMATCH_BROKEN)
4352+#ifndef HAVE_FNMATCH
4353 STATIC int pmatch(const char *, const char *);
4354 #else
4355 #define pmatch(a, b) !fnmatch((a), (b), 0)
4356@@ -1159,7 +1150,7 @@ ifsfree(void)
4357 * should be escapes. The results are stored in the list exparg.
4358 */
4359
4360-#if defined(__GLIBC__) && !defined(FNMATCH_BROKEN) && !defined(GLOB_BROKEN)
4361+#ifdef HAVE_GLOB
4362 STATIC void
4363 expandmeta(str, flag)
4364 struct strlist *str;
4365@@ -1220,7 +1211,7 @@ addglob(pglob)
4366 }
4367
4368
4369-#else /* defined(__GLIBC__) && !defined(FNMATCH_BROKEN) && !defined(GLOB_BROKEN) */
4370+#else /* HAVE_GLOB */
4371 STATIC char *expdir;
4372
4373
4374@@ -1387,7 +1378,7 @@ out:
4375 if (! atend)
4376 endname[-1] = '/';
4377 }
4378-#endif /* defined(__GLIBC__) && !defined(FNMATCH_BROKEN) && !defined(GLOB_BROKEN) */
4379+#endif /* HAVE_GLOB */
4380
4381
4382 /*
4383@@ -1406,7 +1397,7 @@ addfname(char *name)
4384 }
4385
4386
4387-#if !(defined(__GLIBC__) && !defined(FNMATCH_BROKEN) && !defined(GLOB_BROKEN))
4388+#ifndef HAVE_GLOB
4389 /*
4390 * Sort the results of file name expansion. It calculates the number of
4391 * strings to sort and then calls msort (short for merge sort) to do the
4392@@ -1479,7 +1470,7 @@ patmatch(char *pattern, const char *string)
4393 }
4394
4395
4396-#if !defined(__GLIBC__) || defined(FNMATCH_BROKEN)
4397+#ifndef HAVE_FNMATCH
4398 STATIC int ccmatch(const char *p, int chr, const char **r)
4399 {
4400 static const struct class {
4401--
44021.5.5
4403
4404From f22cfbd19cbadbc9b01733cdd20ed2336b7fcb25 Mon Sep 17 00:00:00 2001
4405From: Herbert Xu <herbert@gondor.apana.org.au>
4406Date: Sat, 20 Oct 2007 18:49:31 +0800
4407Subject: [PATCH] [PARSER] Fix here-doc corruption
4408
4409The change
4410
4411 [PARSER] Recognise here-doc delimiters terminated by EOF
4412
4413introduced a regerssion whereby lines starting with eofmark but are not equal
4414to eofmark would be corrupted. This patch fixes it.
4415
4416Test case:
4417
4418 cat << _ACEOF
4419 _ASBOX
4420 _ACEOF
4421
4422Old result:
4423
4424 SASBOX
4425
4426New result:
4427
4428 _ASBOX
4429---
4430 ChangeLog | 1 +
4431 src/parser.c | 11 ++++++-----
4432 2 files changed, 7 insertions(+), 5 deletions(-)
4433
4434diff --git a/ChangeLog b/ChangeLog
4435index a821c32..d50d36c 100644
4436--- a/ChangeLog
4437+++ b/ChangeLog
4438@@ -1,6 +1,7 @@
4439 2007-10-20 Herbert Xu <herbert@gondor.apana.org.au>
4440
4441 * Added configure --enable-glob and --enable-fnmatch options.
4442+ * Fix here-doc corruption.
4443
4444 2007-10-17 Herbert Xu <herbert@gondor.apana.org.au>
4445
4446diff --git a/src/parser.c b/src/parser.c
4447index 4b8a5fe..3832f0b 100644
4448--- a/src/parser.c
4449+++ b/src/parser.c
4450@@ -1047,16 +1047,17 @@ checkend: {
4451 if (c == *eofmark) {
4452 if (pfgets(line, sizeof line) != NULL) {
4453 char *p, *q;
4454+ int cc;
4455
4456 p = line;
4457 for (q = eofmark + 1;; p++, q++) {
4458- c = *p;
4459- if (c == '\n')
4460- c = 0;
4461- if (!*q || c != *q)
4462+ cc = *p;
4463+ if (cc == '\n')
4464+ cc = 0;
4465+ if (!*q || cc != *q)
4466 break;
4467 }
4468- if (c == *q) {
4469+ if (cc == *q) {
4470 c = PEOF;
4471 plinno++;
4472 needprompt = doprompt;
4473--
44741.5.5
4475
4476From 042874b59ff2a4264ba31e3fac68a8410f3b0d3c Mon Sep 17 00:00:00 2001
4477From: Herbert Xu <herbert@gondor.apana.org.au>
4478Date: Sun, 11 Nov 2007 14:21:23 +0800
4479Subject: [PATCH] [PARSER] Removed noexpand/length check on eofmark
4480
4481On Tue, Oct 30, 2007 at 04:23:35AM +0000, Oleg Verych wrote:
4482>
4483> } 8<<""
4484> ======================
4485
4486Actually this (the empty delim) only works with dash by accident.
4487I've tried bash and pdksh and they both terminate on the first
4488empty line which is what you would expect rather than EOF. The
4489real Korn shell does something completely different.
4490
4491I've fixed this in dash to conform to bash/pdksh.
4492
4493> In [0] it's stated, that delimiter isn't evaluated (expanded), only
4494> quoiting must be checked. That if() seems to be completely bogus.
4495
4496OK I agree. The reason it was there is because the parser would
4497have already replaced the dollar sign by an internal representation.
4498
4499I've fixed it properly with this patch.
4500
4501Test case:
4502
4503 cat <<- $a
4504 OK
4505 $a
4506
4507 cat <<- ""
4508 OK
4509
4510 echo OK
4511
4512Old result:
4513
4514 dash: Syntax error: Illegal eof marker for << redirection
4515 OK
4516
4517 echo OK
4518
4519New result:
4520
4521 OK
4522 OK
4523 OK
4524---
4525 ChangeLog | 4 ++
4526 src/input.c | 27 ------------------
4527 src/input.h | 1 -
4528 src/parser.c | 88 +++++++++++++++++++++++++--------------------------------
4529 src/parser.h | 1 +
4530 5 files changed, 44 insertions(+), 77 deletions(-)
4531
4532diff --git a/ChangeLog b/ChangeLog
4533index d50d36c..ad98810 100644
4534--- a/ChangeLog
4535+++ b/ChangeLog
4536@@ -1,3 +1,7 @@
4537+2007-11-11 Herbert Xu <herbert@gondor.apana.org.au>
4538+
4539+ * Removed noexpand/length check on eofmark.
4540+
4541 2007-10-20 Herbert Xu <herbert@gondor.apana.org.au>
4542
4543 * Added configure --enable-glob and --enable-fnmatch options.
4544diff --git a/src/input.c b/src/input.c
4545index 11f7a3f..bc84e57 100644
4546--- a/src/input.c
4547+++ b/src/input.c
4548@@ -125,33 +125,6 @@ RESET {
4549
4550
4551 /*
4552- * Read a line from the script.
4553- */
4554-
4555-char *
4556-pfgets(char *line, int len)
4557-{
4558- char *p = line;
4559- int nleft = len;
4560- int c;
4561-
4562- while (--nleft > 0) {
4563- c = pgetc2();
4564- if (c == PEOF) {
4565- if (p == line)
4566- return NULL;
4567- break;
4568- }
4569- *p++ = c;
4570- if (c == '\n')
4571- break;
4572- }
4573- *p = '\0';
4574- return line;
4575-}
4576-
4577-
4578-/*
4579 * Read a character from the script, returning PEOF on end of file.
4580 * Nul characters in the input are silently discarded.
4581 */
4582diff --git a/src/input.h b/src/input.h
4583index 1ed9ddf..1d6f528 100644
4584--- a/src/input.h
4585+++ b/src/input.h
4586@@ -50,7 +50,6 @@ extern int plinno;
4587 extern int parsenleft; /* number of characters left in input buffer */
4588 extern char *parsenextc; /* next character in input buffer */
4589
4590-char *pfgets(char *, int);
4591 int pgetc(void);
4592 int pgetc2(void);
4593 int preadbuffer(void);
4594diff --git a/src/parser.c b/src/parser.c
4595index 3832f0b..2d20b00 100644
4596--- a/src/parser.c
4597+++ b/src/parser.c
4598@@ -59,8 +59,6 @@
4599 * Shell command parser.
4600 */
4601
4602-#define EOFMARKLEN 79
4603-
4604 /* values returned by readtoken */
4605 #include "token.h"
4606
4607@@ -101,7 +99,6 @@ STATIC int peektoken(void);
4608 STATIC int readtoken(void);
4609 STATIC int xxreadtoken(void);
4610 STATIC int readtoken1(int, char const *, char *, int);
4611-STATIC int noexpand(char *);
4612 STATIC void synexpect(int) __attribute__((__noreturn__));
4613 STATIC void synerror(const char *) __attribute__((__noreturn__));
4614 STATIC void setprompt(int);
4615@@ -596,18 +593,17 @@ parsefname(void)
4616 {
4617 union node *n = redirnode;
4618
4619+ if (n->type == NHERE)
4620+ checkkwd = CHKEOFMARK;
4621 if (readtoken() != TWORD)
4622 synexpect(-1);
4623 if (n->type == NHERE) {
4624 struct heredoc *here = heredoc;
4625 struct heredoc *p;
4626- int i;
4627
4628 if (quoteflag == 0)
4629 n->type = NXHERE;
4630 TRACE(("Here document %d\n", n->type));
4631- if (! noexpand(wordtext) || (i = strlen(wordtext)) == 0 || i > EOFMARKLEN)
4632- synerror("Illegal eof marker for << redirection");
4633 rmescapes(wordtext);
4634 here->eofmark = wordtext;
4635 here->next = NULL;
4636@@ -836,7 +832,6 @@ readtoken1(int firstc, char const *syntax, char *eofmark, int striptabs)
4637 int c = firstc;
4638 char *out;
4639 int len;
4640- char line[EOFMARKLEN + 1];
4641 struct nodelist *bqlist;
4642 int quotef;
4643 int dblquote;
4644@@ -1036,6 +1031,9 @@ endword:
4645
4646 checkend: {
4647 if (eofmark) {
4648+ int markloc;
4649+ char *p;
4650+
4651 if (c == PEOA) {
4652 c = pgetc2();
4653 }
4654@@ -1044,28 +1042,42 @@ checkend: {
4655 c = pgetc2();
4656 }
4657 }
4658- if (c == *eofmark) {
4659- if (pfgets(line, sizeof line) != NULL) {
4660- char *p, *q;
4661- int cc;
4662-
4663- p = line;
4664- for (q = eofmark + 1;; p++, q++) {
4665- cc = *p;
4666- if (cc == '\n')
4667- cc = 0;
4668- if (!*q || cc != *q)
4669- break;
4670- }
4671- if (cc == *q) {
4672- c = PEOF;
4673- plinno++;
4674- needprompt = doprompt;
4675- } else {
4676- pushstring(line, NULL);
4677+
4678+ markloc = out - (char *)stackblock();
4679+ for (p = eofmark; STPUTC(c, out), *p; p++) {
4680+ if (c != *p)
4681+ goto more_heredoc;
4682+
4683+ c = pgetc2();
4684+ }
4685+
4686+ if (c == '\n' || c == PEOF) {
4687+ c = PEOF;
4688+ plinno++;
4689+ needprompt = doprompt;
4690+ } else {
4691+ int len;
4692+
4693+more_heredoc:
4694+ p = (char *)stackblock() + markloc + 1;
4695+ len = out - p;
4696+
4697+ if (len) {
4698+ len -= c < 0;
4699+ c = p[-1];
4700+
4701+ if (len) {
4702+ char *str;
4703+
4704+ str = alloca(len + 1);
4705+ *(char *)mempcpy(str, p, len) = 0;
4706+
4707+ pushstring(str, NULL);
4708 }
4709 }
4710 }
4711+
4712+ STADJUST((char *)stackblock() + markloc - out, out);
4713 }
4714 goto checkend_return;
4715 }
4716@@ -1148,6 +1160,7 @@ parsesub: {
4717
4718 c = pgetc();
4719 if (
4720+ (checkkwd & CHKEOFMARK) ||
4721 c <= PEOA ||
4722 (c != '(' && c != '{' && !is_name(c) && !is_special(c))
4723 ) {
4724@@ -1400,29 +1413,6 @@ RESET {
4725 }
4726 #endif
4727
4728-/*
4729- * Returns true if the text contains nothing to expand (no dollar signs
4730- * or backquotes).
4731- */
4732-
4733-STATIC int
4734-noexpand(char *text)
4735-{
4736- char *p;
4737- signed char c;
4738-
4739- p = text;
4740- while ((c = *p++) != '\0') {
4741- if (c == CTLQUOTEMARK)
4742- continue;
4743- if (c == CTLESC)
4744- p++;
4745- else if (BASESYNTAX[(int)c] == CCTL)
4746- return 0;
4747- }
4748- return 1;
4749-}
4750-
4751
4752 /*
4753 * Return of a legal variable name (a letter or underscore followed by zero or
4754diff --git a/src/parser.h b/src/parser.h
4755index badbd07..6bdf1c9 100644
4756--- a/src/parser.h
4757+++ b/src/parser.h
4758@@ -65,6 +65,7 @@
4759 #define CHKALIAS 0x1
4760 #define CHKKWD 0x2
4761 #define CHKNL 0x4
4762+#define CHKEOFMARK 0x8
4763
4764
4765 /*
4766--
47671.5.5
4768
4769From 3bcc676119296304eaf2d73831d5ab80c4206b45 Mon Sep 17 00:00:00 2001
4770From: Herbert Xu <herbert@gondor.apana.org.au>
4771Date: Sun, 11 Nov 2007 15:00:06 +0800
4772Subject: [PATCH] [EXPAND] Removed herefd hack
4773
4774The herefd hack goes back more than a decade. it limits the amount of
4775memory we have to allocate when expanding here-documents by writing the
4776result out from time to time. However, it's no longer safe because the
4777stack is used to place intermediate results too and there we certainly
4778don't want to write them out should we be short on memory.
4779
4780In any case, with today's computers we can afford to keep the entire
4781result in memory and write them out at the end.
4782---
4783 ChangeLog | 1 +
4784 src/eval.c | 6 ------
4785 src/expand.c | 4 ----
4786 src/memalloc.c | 5 -----
4787 src/memalloc.h | 1 -
4788 5 files changed, 1 insertions(+), 16 deletions(-)
4789
4790diff --git a/ChangeLog b/ChangeLog
4791index ad98810..39940b9 100644
4792--- a/ChangeLog
4793+++ b/ChangeLog
4794@@ -1,6 +1,7 @@
4795 2007-11-11 Herbert Xu <herbert@gondor.apana.org.au>
4796
4797 * Removed noexpand/length check on eofmark.
4798+ * Removed herefd hack.
4799
4800 2007-10-20 Herbert Xu <herbert@gondor.apana.org.au>
4801
4802diff --git a/src/eval.c b/src/eval.c
4803index 17b558d..a8feaa0 100644
4804--- a/src/eval.c
4805+++ b/src/eval.c
4806@@ -577,8 +577,6 @@ evalpipe(union node *n, int flags)
4807 void
4808 evalbackcmd(union node *n, struct backcmd *result)
4809 {
4810- int saveherefd;
4811-
4812 result->fd = -1;
4813 result->buf = NULL;
4814 result->nleft = 0;
4815@@ -587,9 +585,6 @@ evalbackcmd(union node *n, struct backcmd *result)
4816 goto out;
4817 }
4818
4819- saveherefd = herefd;
4820- herefd = -1;
4821-
4822 #ifdef notyet
4823 /*
4824 * For now we disable executing builtins in the same
4825@@ -636,7 +631,6 @@ evalbackcmd(union node *n, struct backcmd *result)
4826 result->fd = pip[0];
4827 result->jp = jp;
4828 }
4829- herefd = saveherefd;
4830 out:
4831 TRACE(("evalbackcmd done: fd=%d buf=0x%x nleft=%d jp=0x%x\n",
4832 result->fd, result->buf, result->nleft, result->jp));
4833diff --git a/src/expand.c b/src/expand.c
4834index c489446..ee699e8 100644
4835--- a/src/expand.c
4836+++ b/src/expand.c
4837@@ -184,7 +184,6 @@ static inline const char *getpwhome(const char *name)
4838 void
4839 expandhere(union node *arg, int fd)
4840 {
4841- herefd = fd;
4842 expandarg(arg, (struct arglist *)NULL, EXP_QUOTED);
4843 xwrite(fd, stackblock(), expdest - (char *)stackblock());
4844 }
4845@@ -663,18 +662,15 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varfla
4846 int quotes = flag & QUOTES_ESC;
4847 char *startp;
4848 char *loc;
4849- int saveherefd = herefd;
4850 struct nodelist *saveargbackq = argbackq;
4851 int amount;
4852 char *rmesc, *rmescend;
4853 int zero;
4854 char *(*scan)(char *, char *, char *, char *, int , int);
4855
4856- herefd = -1;
4857 argstr(p, EXP_TILDE | (subtype != VSASSIGN && subtype != VSQUESTION ?
4858 (flag & EXP_QUOTED ? EXP_QPAT : EXP_CASE) : 0));
4859 STPUTC('\0', expdest);
4860- herefd = saveherefd;
4861 argbackq = saveargbackq;
4862 startp = stackblock() + startloc;
4863
4864diff --git a/src/memalloc.c b/src/memalloc.c
4865index 8d3e2ed..e75e609 100644
4866--- a/src/memalloc.c
4867+++ b/src/memalloc.c
4868@@ -109,7 +109,6 @@ struct stack_block *stackp = &stackbase;
4869 char *stacknxt = stackbase.space;
4870 size_t stacknleft = MINSIZE;
4871 char *sstrend = stackbase.space + MINSIZE;
4872-int herefd = -1;
4873
4874 pointer
4875 stalloc(size_t nbytes)
4876@@ -264,10 +263,6 @@ void *
4877 growstackstr(void)
4878 {
4879 size_t len = stackblocksize();
4880- if (herefd >= 0 && len >= 1024) {
4881- xwrite(herefd, stackblock(), len);
4882- return stackblock();
4883- }
4884 growstackblock();
4885 return stackblock() + len;
4886 }
4887diff --git a/src/memalloc.h b/src/memalloc.h
4888index ad6015d..4b5be46 100644
4889--- a/src/memalloc.h
4890+++ b/src/memalloc.h
4891@@ -46,7 +46,6 @@ struct stackmark {
4892 extern char *stacknxt;
4893 extern size_t stacknleft;
4894 extern char *sstrend;
4895-extern int herefd;
4896
4897 pointer ckmalloc(size_t);
4898 pointer ckrealloc(pointer, size_t);
4899--
49001.5.5
4901
4902From 2f0c9d44f44945e49b9e079944dcf01f3477c8dc Mon Sep 17 00:00:00 2001
4903From: Herbert Xu <herbert@gondor.apana.org.au>
4904Date: Sun, 11 Nov 2007 15:27:00 +0800
4905Subject: [PATCH] [EXPAND] Expand here-documents in the current shell environment
4906
4907Previously we always expanded here-documents in a subshell. This is
4908contrary to the POSIX specification and how other shells behave. What's
4909more this slows down many expansions due to the extra fork (however, it
4910must be said that it is possible for it speed up certain expansions by
4911running it simultaneously with the command on two CPUs).
4912
4913This patch move the expansion into the current shell environment.
4914
4915Test case:
4916
4917 unset a
4918 cat <<- EOF > /dev/null
4919 ${a=NOT}
4920 EOF
4921 echo ${a}BAD
4922
4923Old result:
4924
4925 BAD
4926
4927New result:
4928
4929 NOTBAD
4930---
4931 ChangeLog | 1 +
4932 src/expand.c | 12 ------------
4933 src/expand.h | 1 -
4934 src/redir.c | 24 ++++++++++++++----------
4935 4 files changed, 15 insertions(+), 23 deletions(-)
4936
4937diff --git a/ChangeLog b/ChangeLog
4938index 39940b9..de37261 100644
4939--- a/ChangeLog
4940+++ b/ChangeLog
4941@@ -2,6 +2,7 @@
4942
4943 * Removed noexpand/length check on eofmark.
4944 * Removed herefd hack.
4945+ * Expand here-documents in the current shell environment.
4946
4947 2007-10-20 Herbert Xu <herbert@gondor.apana.org.au>
4948
4949diff --git a/src/expand.c b/src/expand.c
4950index ee699e8..f3d63c4 100644
4951--- a/src/expand.c
4952+++ b/src/expand.c
4953@@ -178,18 +178,6 @@ static inline const char *getpwhome(const char *name)
4954
4955
4956 /*
4957- * Expand shell variables and backquotes inside a here document.
4958- */
4959-
4960-void
4961-expandhere(union node *arg, int fd)
4962-{
4963- expandarg(arg, (struct arglist *)NULL, EXP_QUOTED);
4964- xwrite(fd, stackblock(), expdest - (char *)stackblock());
4965-}
4966-
4967-
4968-/*
4969 * Perform variable substitution and command substitution on an argument,
4970 * placing the resulting list of arguments in arglist. If EXP_FULL is true,
4971 * perform splitting and file name expansion. When arglist is NULL, perform
4972diff --git a/src/expand.h b/src/expand.h
4973index 225b004..1862aea 100644
4974--- a/src/expand.h
4975+++ b/src/expand.h
4976@@ -62,7 +62,6 @@ struct arglist {
4977
4978
4979 union node;
4980-void expandhere(union node *, int);
4981 void expandarg(union node *, struct arglist *, int);
4982 void expari(int);
4983 #define rmescapes(p) _rmescapes((p), 0)
4984diff --git a/src/redir.c b/src/redir.c
4985index 33dbc88..ce34db0 100644
4986--- a/src/redir.c
4987+++ b/src/redir.c
4988@@ -295,18 +295,25 @@ err:
4989 STATIC int
4990 openhere(union node *redir)
4991 {
4992+ char *p;
4993 int pip[2];
4994 size_t len = 0;
4995
4996 if (pipe(pip) < 0)
4997 sh_error("Pipe call failed");
4998- if (redir->type == NHERE) {
4999- len = strlen(redir->nhere.doc->narg.text);
5000- if (len <= PIPESIZE) {
5001- xwrite(pip[1], redir->nhere.doc->narg.text, len);
5002- goto out;
5003- }
5004+
5005+ p = redir->nhere.doc->narg.text;
5006+ if (redir->type == NXHERE) {
5007+ expandarg(redir->nhere.doc, NULL, EXP_QUOTED);
5008+ p = stackblock();
5009+ }
5010+
5011+ len = strlen(p);
5012+ if (len <= PIPESIZE) {
5013+ xwrite(pip[1], p, len);
5014+ goto out;
5015 }
5016+
5017 if (forkshell((struct job *)NULL, (union node *)NULL, FORK_NOJOB) == 0) {
5018 close(pip[0]);
5019 signal(SIGINT, SIG_IGN);
5020@@ -316,10 +323,7 @@ openhere(union node *redir)
5021 signal(SIGTSTP, SIG_IGN);
5022 #endif
5023 signal(SIGPIPE, SIG_DFL);
5024- if (redir->type == NHERE)
5025- xwrite(pip[1], redir->nhere.doc->narg.text, len);
5026- else
5027- expandhere(redir->nhere.doc, pip[1]);
5028+ xwrite(pip[1], p, len);
5029 _exit(0);
5030 }
5031 out:
5032--
50331.5.5
5034
5035From 1db0b82e3cafe809be176016b1e83a05119eac08 Mon Sep 17 00:00:00 2001
5036From: Steve Langasek <steve.langasek@canonical.com>
5037Date: Sun, 23 Dec 2007 11:02:26 +0800
5038Subject: [PATCH] [EVAL] Fix bad pointer arithmetic in evalcommand
5039
5040dash dies on sparc with a SIGBUS due to an arithmetic error introduced
5041with commit 03b4958, this patch fixes it.
5042---
5043 ChangeLog | 4 ++++
5044 src/eval.c | 3 ++-
5045 2 files changed, 6 insertions(+), 1 deletions(-)
5046
5047diff --git a/ChangeLog b/ChangeLog
5048index de37261..e72849c 100644
5049--- a/ChangeLog
5050+++ b/ChangeLog
5051@@ -1,3 +1,7 @@
5052+2007-12-23 Steve Langasek <steve.langasek@canonical.com>
5053+
5054+ * Fixed bad pointer arithmetic in evalcommand.
5055+
5056 2007-11-11 Herbert Xu <herbert@gondor.apana.org.au>
5057
5058 * Removed noexpand/length check on eofmark.
5059diff --git a/src/eval.c b/src/eval.c
5060index a8feaa0..77291b4 100644
5061--- a/src/eval.c
5062+++ b/src/eval.c
5063@@ -722,7 +722,8 @@ evalcommand(union node *cmd, int flags)
5064 }
5065
5066 /* Reserve one extra spot at the front for shellexec. */
5067- argv = nargv = stalloc(sizeof (char *) * (argc + 2)) + 1;
5068+ nargv = stalloc(sizeof (char *) * (argc + 2));
5069+ argv = ++nargv;
5070 for (sp = arglist.list ; sp ; sp = sp->next) {
5071 TRACE(("evalcommand arg: %s\n", sp->text));
5072 *nargv++ = sp->text;
5073--
50741.5.5
5075
5076From e3806e06bd39fb62033646b812937a1712fd78ed Mon Sep 17 00:00:00 2001
5077From: Richard M Kreuter <kreuter@progn.net>
5078Date: Sun, 23 Dec 2007 11:24:48 +0800
5079Subject: [PATCH] [BUILTIN] Add set +o support
5080
5081The dash(1) in Debian stable does not support "set +o" in the manner
5082specified by SUSv3:
5083
5084|+o
5085| Write the current option settings to standard output in a format
5086| that is suitable for reinput to the shell as commands that
5087| achieve the same options settings.
5088
5089(citation from
5090http://www.opengroup.org/onlinepubs/009695399/utilities/set.html)
5091
5092Instead, dash's "set +o" prints the shell's options in a
5093human-readable format.
5094
5095Here is a simple test program that exercises this feature; it works as
5096I believe is required under bash, but not under dash.
5097
5098 # Save the shell's options
5099 set +o > /tmp/settings-commands
5100 set -o | sort > /tmp/settings-before
5101 # Change some options.
5102 set -v
5103 set -f
5104 set -x
5105 set +o emacs
5106 set -o vi
5107 # Try to restore our options.
5108 . /tmp/settings-commands
5109 set -o | sort > /tmp/settings-after
5110 # Compare.
5111 diff /tmp/settings-before /tmp/settings-after
5112
5113I believe the following small patch adds this feature to dash, and
5114documents it in the manual page:
5115
5116Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
5117---
5118 ChangeLog | 4 ++++
5119 src/dash.1 | 5 +++++
5120 src/options.c | 16 ++++++++++++----
5121 3 files changed, 21 insertions(+), 4 deletions(-)
5122
5123diff --git a/ChangeLog b/ChangeLog
5124index e72849c..10ec45c 100644
5125--- a/ChangeLog
5126+++ b/ChangeLog
5127@@ -1,3 +1,7 @@
5128+2007-12-23 Richard M Kreuter <kreuter@progn.net>
5129+
5130+ * Add set +o support.
5131+
5132 2007-12-23 Steve Langasek <steve.langasek@canonical.com>
5133
5134 * Fixed bad pointer arithmetic in evalcommand.
5135diff --git a/src/dash.1 b/src/dash.1
5136index 9b8ab0e..b4140eb 100644
5137--- a/src/dash.1
5138+++ b/src/dash.1
5139@@ -1782,6 +1782,11 @@ With no arguments, it lists the values of all shell variables.
5140 If options are given, it sets the specified option
5141 flags, or clears them as described in the section called
5142 .Sx Argument List Processing .
5143+As a special case, if the option is -o or +o and no argument is
5144+supplied, the shell prints the settings of all its options. If the
5145+option is -o, the settings are printed in a human-readable format; if
5146+the option is +o, the settings are printed in a format suitable for
5147+reinput to the shell to affect the same option settings.
5148 .Pp
5149 The third use of the set command is to set the values of the shell's
5150 positional parameters to the specified args.
5151diff --git a/src/options.c b/src/options.c
5152index f669117..48c9671 100644
5153--- a/src/options.c
5154+++ b/src/options.c
5155@@ -240,10 +240,18 @@ minus_o(char *name, int val)
5156 int i;
5157
5158 if (name == NULL) {
5159- out1str("Current option settings\n");
5160- for (i = 0; i < NOPTS; i++)
5161- out1fmt("%-16s%s\n", optnames[i],
5162- optlist[i] ? "on" : "off");
5163+ if (val) {
5164+ out1str("Current option settings\n");
5165+ for (i = 0; i < NOPTS; i++)
5166+ out1fmt("%-16s%s\n", optnames[i],
5167+ optlist[i] ? "on" : "off");
5168+ } else {
5169+ for (i = 0; i < NOPTS; i++)
5170+ out1fmt("set %s %s\n",
5171+ optlist[i] ? "-o" : "+o",
5172+ optnames[i]);
5173+
5174+ }
5175 } else {
5176 for (i = 0; i < NOPTS; i++)
5177 if (equal(name, optnames[i])) {
5178--
51791.5.5
5180
5181From 509ca4a5a2699af4bce734dfb9efa10e2b5f631d Mon Sep 17 00:00:00 2001
5182From: Gerrit Pape <pape@smarden.org>
5183Date: Sun, 23 Dec 2007 21:24:37 +0800
5184Subject: [PATCH] [ARITH] If imaxdiv() isn't available, use / and % operators
5185
5186Although in posix, imaxdiv() isn't implemented on Debian/alpha, causing
5187dash to fail to build. So use / and % operators if imaxdiv() isn't
5188available.
5189
5190 http://bugs.debian.org/456398
5191
5192Signed-off-by: Gerrit Pape <pape@smarden.org>
5193Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
5194---
5195 ChangeLog | 4 ++++
5196 configure.ac | 5 +++--
5197 src/arith_yacc.c | 6 ++++++
5198 3 files changed, 13 insertions(+), 2 deletions(-)
5199
5200diff --git a/ChangeLog b/ChangeLog
5201index 10ec45c..56acd66 100644
5202--- a/ChangeLog
5203+++ b/ChangeLog
5204@@ -1,3 +1,7 @@
5205+2007-12-23 Gerrit Pape <pape@smarden.org>
5206+
5207+ * If imaxdiv() isn't available, use / and % operators.
5208+
5209 2007-12-23 Richard M Kreuter <kreuter@progn.net>
5210
5211 * Add set +o support.
5212diff --git a/configure.ac b/configure.ac
5213index ccc4ac1..4d739c2 100644
5214--- a/configure.ac
5215+++ b/configure.ac
5216@@ -33,8 +33,9 @@ dnl Checks for libraries.
5217 dnl Checks for header files.
5218
5219 dnl Checks for library functions.
5220-AC_CHECK_FUNCS(bsearch getpwnam getrlimit isalpha killpg mempcpy sigsetmask \
5221- stpcpy strchrnul strsignal strtod strtoimax strtoumax sysconf)
5222+AC_CHECK_FUNCS(bsearch getpwnam getrlimit imaxdiv isalpha killpg mempcpy \
5223+ sigsetmask stpcpy strchrnul strsignal strtod strtoimax \
5224+ strtoumax sysconf)
5225
5226 if test "$enable_fnmatch" = yes; then
5227 use_fnmatch=
5228diff --git a/src/arith_yacc.c b/src/arith_yacc.c
5229index e473594..f4857fe 100644
5230--- a/src/arith_yacc.c
5231+++ b/src/arith_yacc.c
5232@@ -88,7 +88,9 @@ static inline int higher_prec(int op1, int op2)
5233
5234 static intmax_t do_binop(int op, intmax_t a, intmax_t b)
5235 {
5236+#ifdef HAVE_IMAXDIV
5237 imaxdiv_t div;
5238+#endif
5239
5240 switch (op) {
5241 default:
5242@@ -96,8 +98,12 @@ static intmax_t do_binop(int op, intmax_t a, intmax_t b)
5243 case ARITH_DIV:
5244 if (!b)
5245 yyerror("division by zero");
5246+#ifdef HAVE_IMAXDIV
5247 div = imaxdiv(a, b);
5248 return op == ARITH_REM ? div.rem : div.quot;
5249+#else
5250+ return op == ARITH_REM ? a % b : a / b;
5251+#endif
5252 case ARITH_MUL:
5253 return a * b;
5254 case ARITH_ADD:
5255--
52561.5.5
5257
5258From 6b46a86991dff7af70dfd249c27767be9b7d4c97 Mon Sep 17 00:00:00 2001
5259From: Herbert Xu <herbert@gondor.apana.org.au>
5260Date: Thu, 27 Dec 2007 13:54:16 +1100
5261Subject: [PATCH] [PARSER] Add FAKEEOFMARK for expandstr
5262
5263Previously expandstr used the string "" to indicate that it needs to be
5264treated just like a here-doc except that there is no terminator. However,
5265the string "" is in fact a valid here-doc terminator so now that we deal
5266with it correctly expandstr no longer works in the presence of new-lines
5267in the prompt.
5268
5269This patch introduces the FAKEEOFMARK macro which does not equal any
5270real EOF marker but is distinct from the NULL pointer which is used to
5271indicate non-here-doc contexts.
5272
5273Thanks to Markus Triska for reporting this regression.
5274
5275Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
5276---
5277 ChangeLog | 4 ++++
5278 src/parser.c | 14 ++++++++++++--
5279 2 files changed, 16 insertions(+), 2 deletions(-)
5280
5281diff --git a/ChangeLog b/ChangeLog
5282index 56acd66..8b392f4 100644
5283--- a/ChangeLog
5284+++ b/ChangeLog
5285@@ -1,3 +1,7 @@
5286+2007-12-27 Herbert Xu <herbert@gondor.apana.org.au>
5287+
5288+ * Add FAKEEOFMARK for expandstr.
5289+
5290 2007-12-23 Gerrit Pape <pape@smarden.org>
5291
5292 * If imaxdiv() isn't available, use / and % operators.
5293diff --git a/src/parser.c b/src/parser.c
5294index 2d20b00..3206328 100644
5295--- a/src/parser.c
5296+++ b/src/parser.c
5297@@ -64,6 +64,11 @@
5298
5299
5300
5301+/* Used by expandstr to get here-doc like behaviour. */
5302+#define FAKEEOFMARK (char *)1
5303+
5304+
5305+
5306 struct heredoc {
5307 struct heredoc *next; /* next here document in list */
5308 union node *here; /* redirection node */
5309@@ -113,6 +118,11 @@ isassignment(const char *p)
5310 return *q == '=';
5311 }
5312
5313+static inline int realeofmark(const char *eofmark)
5314+{
5315+ return eofmark && eofmark != FAKEEOFMARK;
5316+}
5317+
5318
5319 /*
5320 * Read and parse a command. Returns NEOF on end of file. (NULL is a
5321@@ -1030,7 +1040,7 @@ endword:
5322 */
5323
5324 checkend: {
5325- if (eofmark) {
5326+ if (realeofmark(eofmark)) {
5327 int markloc;
5328 char *p;
5329
5330@@ -1492,7 +1502,7 @@ expandstr(const char *ps)
5331
5332 /* XXX Fix (char *) cast. */
5333 setinputstring((char *)ps);
5334- readtoken1(pgetc(), DQSYNTAX, nullstr, 0);
5335+ readtoken1(pgetc(), DQSYNTAX, FAKEEOFMARK, 0);
5336 popfile();
5337
5338 n.narg.type = NARG;
5339--
53401.5.5
5341
5342From 8cbde910100fa6b708c3eeb35cfd366726034967 Mon Sep 17 00:00:00 2001
5343From: Herbert Xu <herbert@gondor.apana.org.au>
5344Date: Thu, 27 Dec 2007 13:57:07 +1100
5345Subject: [PATCH] [PARSER] Do not show prompts in expandstr
5346
5347Once I fixed the previous problem it became apparent that we never dealt
5348with prompts with new-lines in them correctly. The problem is that we
5349showed a secondary prompt for each of them.
5350
5351This patch disables prompt generation in expandstr.
5352
5353Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
5354---
5355 ChangeLog | 1 +
5356 src/parser.c | 8 ++++++++
5357 2 files changed, 9 insertions(+), 0 deletions(-)
5358
5359diff --git a/ChangeLog b/ChangeLog
5360index 8b392f4..0030738 100644
5361--- a/ChangeLog
5362+++ b/ChangeLog
5363@@ -1,6 +1,7 @@
5364 2007-12-27 Herbert Xu <herbert@gondor.apana.org.au>
5365
5366 * Add FAKEEOFMARK for expandstr.
5367+ * Do not show prompts in expandstr.
5368
5369 2007-12-23 Gerrit Pape <pape@smarden.org>
5370
5371diff --git a/src/parser.c b/src/parser.c
5372index 3206328..9dd6185 100644
5373--- a/src/parser.c
5374+++ b/src/parser.c
5375@@ -1499,10 +1499,18 @@ const char *
5376 expandstr(const char *ps)
5377 {
5378 union node n;
5379+ int saveprompt;
5380
5381 /* XXX Fix (char *) cast. */
5382 setinputstring((char *)ps);
5383+
5384+ saveprompt = doprompt;
5385+ doprompt = 0;
5386+
5387 readtoken1(pgetc(), DQSYNTAX, FAKEEOFMARK, 0);
5388+
5389+ doprompt = saveprompt;
5390+
5391 popfile();
5392
5393 n.narg.type = NARG;
5394--
53951.5.5
5396
5397From 8eacbcc79c48f2656127f488ef3172d69e092343 Mon Sep 17 00:00:00 2001
5398From: Herbert Xu <herbert@gondor.apana.org.au>
5399Date: Tue, 1 Jan 2008 13:46:01 +1100
5400Subject: [PATCH] [EXPAND] Fix slash treatment in expmeta
5401
5402The change
5403
5404 [EXPAND] Do not quote back slashes in parameter expansions outside quotes
5405
5406triggered a latent bug in expmeta where the forward slashes when preceded
5407by a blackslash weren't recognised as directory separators. This was hidden
5408because a work-around was put in place for glob(3) which meant that we never
5409had any backslashes immediately before forward slashes.
5410
5411This patch fixes the metaflag loop to recognise forward slashes even when
5412they follow a backslash.
5413
5414Thanks to Daniel Hahler for reporting this problem.
5415
5416Test case:
5417
5418 echo "/"root*
5419
5420Old result:
5421
5422 /root*
5423
5424New result:
5425
5426 /root
5427
5428Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
5429---
5430 ChangeLog | 4 ++++
5431 src/expand.c | 15 ++++++++-------
5432 2 files changed, 12 insertions(+), 7 deletions(-)
5433
5434diff --git a/ChangeLog b/ChangeLog
5435index 0030738..4ed9125 100644
5436--- a/ChangeLog
5437+++ b/ChangeLog
5438@@ -1,3 +1,7 @@
5439+2008-01-01 Herbert Xu <herbert@gondor.apana.org.au>
5440+
5441+ * Fix slash treatment in expmeta.
5442+
5443 2007-12-27 Herbert Xu <herbert@gondor.apana.org.au>
5444
5445 * Add FAKEEOFMARK for expandstr.
5446diff --git a/src/expand.c b/src/expand.c
5447index f3d63c4..5986236 100644
5448--- a/src/expand.c
5449+++ b/src/expand.c
5450@@ -1287,15 +1287,16 @@ expmeta(char *enddir, char *name)
5451 break;
5452 }
5453 }
5454- } else if (*p == '\\')
5455- p++;
5456- else if (*p == '/') {
5457- if (metaflag)
5458- goto out;
5459- start = p + 1;
5460+ } else {
5461+ if (*p == '\\')
5462+ p++;
5463+ if (*p == '/') {
5464+ if (metaflag)
5465+ break;
5466+ start = p + 1;
5467+ }
5468 }
5469 }
5470-out:
5471 if (metaflag == 0) { /* we've reached the end of the file name */
5472 if (enddir != expdir)
5473 metaflag++;
5474--
54751.5.5
5476
5477From c696bc5f353a57ec0f12b3e8fcecc0a2004126ec Mon Sep 17 00:00:00 2001
5478From: Gerrit Pape <pape@smarden.org>
5479Date: Mon, 7 Jan 2008 09:26:06 +0000
5480Subject: [PATCH] run aclocal && autoconf && autoheader && automake
5481
5482---
5483 Makefile.in | 133 +-
5484 aclocal.m4 | 174 ++-
5485 config.h.in | 9 +
5486 configure | 4909 +++++++++++++++++++++++++++++++------------------------
5487 src/Makefile.in | 175 +--
5488 5 files changed, 3074 insertions(+), 2326 deletions(-)
5489
5490diff --git a/Makefile.in b/Makefile.in
5491index 943db1b..b646890 100644
5492--- a/Makefile.in
5493+++ b/Makefile.in
5494@@ -1,8 +1,8 @@
5495-# Makefile.in generated by automake 1.9.5 from Makefile.am.
5496+# Makefile.in generated by automake 1.10 from Makefile.am.
5497 # @configure_input@
5498
5499 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
5500-# 2003, 2004, 2005 Free Software Foundation, Inc.
5501+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
5502 # This Makefile.in is free software; the Free Software Foundation
5503 # gives unlimited permission to copy and/or distribute it,
5504 # with or without modifications, as long as this notice is preserved.
5505@@ -13,15 +13,11 @@
5506 # PARTICULAR PURPOSE.
5507
5508 @SET_MAKE@
5509-srcdir = @srcdir@
5510-top_srcdir = @top_srcdir@
5511 VPATH = @srcdir@
5512 pkgdatadir = $(datadir)/@PACKAGE@
5513 pkglibdir = $(libdir)/@PACKAGE@
5514 pkgincludedir = $(includedir)/@PACKAGE@
5515-top_builddir = .
5516 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
5517-INSTALL = @INSTALL@
5518 install_sh_DATA = $(install_sh) -c -m 644
5519 install_sh_PROGRAM = $(install_sh) -c
5520 install_sh_SCRIPT = $(install_sh) -c
5521@@ -43,7 +39,7 @@ am__aclocal_m4_deps = $(top_srcdir)/configure.ac
5522 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
5523 $(ACLOCAL_M4)
5524 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
5525- configure.lineno configure.status.lineno
5526+ configure.lineno config.status.lineno
5527 mkinstalldirs = $(install_sh) -d
5528 CONFIG_HEADER = config.h
5529 CONFIG_CLEAN_FILES =
5530@@ -51,10 +47,13 @@ SOURCES =
5531 DIST_SOURCES =
5532 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
5533 html-recursive info-recursive install-data-recursive \
5534- install-exec-recursive install-info-recursive \
5535- install-recursive installcheck-recursive installdirs-recursive \
5536- pdf-recursive ps-recursive uninstall-info-recursive \
5537- uninstall-recursive
5538+ install-dvi-recursive install-exec-recursive \
5539+ install-html-recursive install-info-recursive \
5540+ install-pdf-recursive install-ps-recursive install-recursive \
5541+ installcheck-recursive installdirs-recursive pdf-recursive \
5542+ ps-recursive uninstall-recursive
5543+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
5544+ distclean-recursive maintainer-clean-recursive
5545 ETAGS = etags
5546 CTAGS = ctags
5547 DIST_SUBDIRS = $(SUBDIRS)
5548@@ -70,8 +69,6 @@ GZIP_ENV = --best
5549 distuninstallcheck_listfiles = find . -type f -print
5550 distcleancheck_listfiles = find . -type f -print
5551 ACLOCAL = @ACLOCAL@
5552-AMDEP_FALSE = @AMDEP_FALSE@
5553-AMDEP_TRUE = @AMDEP_TRUE@
5554 AMTAR = @AMTAR@
5555 AUTOCONF = @AUTOCONF@
5556 AUTOHEADER = @AUTOHEADER@
5557@@ -91,6 +88,8 @@ ECHO_N = @ECHO_N@
5558 ECHO_T = @ECHO_T@
5559 EGREP = @EGREP@
5560 EXEEXT = @EXEEXT@
5561+GREP = @GREP@
5562+INSTALL = @INSTALL@
5563 INSTALL_DATA = @INSTALL_DATA@
5564 INSTALL_PROGRAM = @INSTALL_PROGRAM@
5565 INSTALL_SCRIPT = @INSTALL_SCRIPT@
5566@@ -100,6 +99,7 @@ LIBOBJS = @LIBOBJS@
5567 LIBS = @LIBS@
5568 LTLIBOBJS = @LTLIBOBJS@
5569 MAKEINFO = @MAKEINFO@
5570+MKDIR_P = @MKDIR_P@
5571 OBJEXT = @OBJEXT@
5572 PACKAGE = @PACKAGE@
5573 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
5574@@ -113,10 +113,12 @@ SHELL = @SHELL@
5575 STRIP = @STRIP@
5576 VERSION = @VERSION@
5577 YACC = @YACC@
5578+YFLAGS = @YFLAGS@
5579+abs_builddir = @abs_builddir@
5580+abs_srcdir = @abs_srcdir@
5581+abs_top_builddir = @abs_top_builddir@
5582+abs_top_srcdir = @abs_top_srcdir@
5583 ac_ct_CC = @ac_ct_CC@
5584-ac_ct_STRIP = @ac_ct_STRIP@
5585-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
5586-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
5587 am__include = @am__include@
5588 am__leading_dot = @am__leading_dot@
5589 am__quote = @am__quote@
5590@@ -124,24 +126,35 @@ am__tar = @am__tar@
5591 am__untar = @am__untar@
5592 bindir = @bindir@
5593 build_alias = @build_alias@
5594+builddir = @builddir@
5595 datadir = @datadir@
5596+datarootdir = @datarootdir@
5597+docdir = @docdir@
5598+dvidir = @dvidir@
5599 exec_prefix = @exec_prefix@
5600 host_alias = @host_alias@
5601+htmldir = @htmldir@
5602 includedir = @includedir@
5603 infodir = @infodir@
5604 install_sh = @install_sh@
5605 libdir = @libdir@
5606 libexecdir = @libexecdir@
5607+localedir = @localedir@
5608 localstatedir = @localstatedir@
5609 mandir = @mandir@
5610 mkdir_p = @mkdir_p@
5611 oldincludedir = @oldincludedir@
5612+pdfdir = @pdfdir@
5613 prefix = @prefix@
5614 program_transform_name = @program_transform_name@
5615+psdir = @psdir@
5616 sbindir = @sbindir@
5617 sharedstatedir = @sharedstatedir@
5618+srcdir = @srcdir@
5619 sysconfdir = @sysconfdir@
5620 target_alias = @target_alias@
5621+top_builddir = @top_builddir@
5622+top_srcdir = @top_srcdir@
5623 SUBDIRS = src
5624 all: config.h
5625 $(MAKE) $(AM_MAKEFLAGS) all-recursive
5626@@ -184,7 +197,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
5627 config.h: stamp-h1
5628 @if test ! -f $@; then \
5629 rm -f stamp-h1; \
5630- $(MAKE) stamp-h1; \
5631+ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
5632 else :; fi
5633
5634 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
5635@@ -197,7 +210,6 @@ $(srcdir)/config.h.in: $(am__configure_deps)
5636
5637 distclean-hdr:
5638 -rm -f config.h stamp-h1
5639-uninstall-info-am:
5640
5641 # This directory's subdirectories are mostly independent; you can cd
5642 # into them and run `make' without going through this Makefile.
5643@@ -230,8 +242,7 @@ $(RECURSIVE_TARGETS):
5644 $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
5645 fi; test -z "$$fail"
5646
5647-mostlyclean-recursive clean-recursive distclean-recursive \
5648-maintainer-clean-recursive:
5649+$(RECURSIVE_CLEAN_TARGETS):
5650 @failcom='exit 1'; \
5651 for f in x $$MAKEFLAGS; do \
5652 case $$f in \
5653@@ -333,23 +344,22 @@ distclean-tags:
5654
5655 distdir: $(DISTFILES)
5656 $(am__remove_distdir)
5657- mkdir $(distdir)
5658- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
5659- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
5660- list='$(DISTFILES)'; for file in $$list; do \
5661- case $$file in \
5662- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
5663- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
5664- esac; \
5665+ test -d $(distdir) || mkdir $(distdir)
5666+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
5667+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
5668+ list='$(DISTFILES)'; \
5669+ dist_files=`for file in $$list; do echo $$file; done | \
5670+ sed -e "s|^$$srcdirstrip/||;t" \
5671+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
5672+ case $$dist_files in \
5673+ */*) $(MKDIR_P) `echo "$$dist_files" | \
5674+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
5675+ sort -u` ;; \
5676+ esac; \
5677+ for file in $$dist_files; do \
5678 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
5679- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
5680- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
5681- dir="/$$dir"; \
5682- $(mkdir_p) "$(distdir)$$dir"; \
5683- else \
5684- dir=''; \
5685- fi; \
5686 if test -d $$d/$$file; then \
5687+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
5688 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
5689 cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
5690 fi; \
5691@@ -363,7 +373,7 @@ distdir: $(DISTFILES)
5692 list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
5693 if test "$$subdir" = .; then :; else \
5694 test -d "$(distdir)/$$subdir" \
5695- || $(mkdir_p) "$(distdir)/$$subdir" \
5696+ || $(MKDIR_P) "$(distdir)/$$subdir" \
5697 || exit 1; \
5698 distdir=`$(am__cd) $(distdir) && pwd`; \
5699 top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
5700@@ -371,6 +381,8 @@ distdir: $(DISTFILES)
5701 $(MAKE) $(AM_MAKEFLAGS) \
5702 top_distdir="$$top_distdir" \
5703 distdir="$$distdir/$$subdir" \
5704+ am__remove_distdir=: \
5705+ am__skip_length_check=: \
5706 distdir) \
5707 || exit 1; \
5708 fi; \
5709@@ -378,7 +390,7 @@ distdir: $(DISTFILES)
5710 -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
5711 ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
5712 ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
5713- ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
5714+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
5715 || chmod -R a+r $(distdir)
5716 dist-gzip: distdir
5717 tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
5718@@ -453,7 +465,7 @@ distcheck: dist
5719 $(am__remove_distdir)
5720 @(echo "$(distdir) archives ready for distribution: "; \
5721 list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
5722- sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
5723+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
5724 distuninstallcheck:
5725 @cd $(distuninstallcheck_dir) \
5726 && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
5727@@ -522,12 +534,20 @@ info-am:
5728
5729 install-data-am:
5730
5731+install-dvi: install-dvi-recursive
5732+
5733 install-exec-am:
5734
5735+install-html: install-html-recursive
5736+
5737 install-info: install-info-recursive
5738
5739 install-man:
5740
5741+install-pdf: install-pdf-recursive
5742+
5743+install-ps: install-ps-recursive
5744+
5745 installcheck-am:
5746
5747 maintainer-clean: maintainer-clean-recursive
5748@@ -548,24 +568,25 @@ ps: ps-recursive
5749
5750 ps-am:
5751
5752-uninstall-am: uninstall-info-am
5753-
5754-uninstall-info: uninstall-info-recursive
5755-
5756-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
5757- check-am clean clean-generic clean-recursive ctags \
5758- ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \
5759- dist-tarZ dist-zip distcheck distclean distclean-generic \
5760- distclean-hdr distclean-recursive distclean-tags \
5761- distcleancheck distdir distuninstallcheck dvi dvi-am html \
5762- html-am info info-am install install-am install-data \
5763- install-data-am install-exec install-exec-am install-info \
5764- install-info-am install-man install-strip installcheck \
5765- installcheck-am installdirs installdirs-am maintainer-clean \
5766- maintainer-clean-generic maintainer-clean-recursive \
5767- mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
5768- pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
5769- uninstall-info-am
5770+uninstall-am:
5771+
5772+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
5773+ install-strip
5774+
5775+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
5776+ all all-am am--refresh check check-am clean clean-generic \
5777+ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
5778+ dist-shar dist-tarZ dist-zip distcheck distclean \
5779+ distclean-generic distclean-hdr distclean-tags distcleancheck \
5780+ distdir distuninstallcheck dvi dvi-am html html-am info \
5781+ info-am install install-am install-data install-data-am \
5782+ install-dvi install-dvi-am install-exec install-exec-am \
5783+ install-html install-html-am install-info install-info-am \
5784+ install-man install-pdf install-pdf-am install-ps \
5785+ install-ps-am install-strip installcheck installcheck-am \
5786+ installdirs installdirs-am maintainer-clean \
5787+ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
5788+ pdf-am ps ps-am tags tags-recursive uninstall uninstall-am
5789
5790 # Tell versions [3.59,3.63) of GNU make to not export all variables.
5791 # Otherwise a system limit (for SysV at least) may be exceeded.
5792diff --git a/aclocal.m4 b/aclocal.m4
5793index 965df90..ce67b57 100644
5794--- a/aclocal.m4
5795+++ b/aclocal.m4
5796@@ -1,7 +1,7 @@
5797-# generated automatically by aclocal 1.9.5 -*- Autoconf -*-
5798+# generated automatically by aclocal 1.10 -*- Autoconf -*-
5799
5800 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
5801-# 2005 Free Software Foundation, Inc.
5802+# 2005, 2006 Free Software Foundation, Inc.
5803 # This file is free software; the Free Software Foundation
5804 # gives unlimited permission to copy and/or distribute it,
5805 # with or without modifications, as long as this notice is preserved.
5806@@ -11,7 +11,12 @@
5807 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
5808 # PARTICULAR PURPOSE.
5809
5810-# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
5811+m4_if(m4_PACKAGE_VERSION, [2.61],,
5812+[m4_fatal([this file was generated for autoconf 2.61.
5813+You have another version of autoconf. If you want to use that,
5814+you should regenerate the build system entirely.], [63])])
5815+
5816+# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
5817 #
5818 # This file is free software; the Free Software Foundation
5819 # gives unlimited permission to copy and/or distribute it,
5820@@ -21,14 +26,29 @@
5821 # ----------------------------
5822 # Automake X.Y traces this macro to ensure aclocal.m4 has been
5823 # generated from the m4 files accompanying Automake X.Y.
5824-AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
5825+# (This private macro should not be called outside this file.)
5826+AC_DEFUN([AM_AUTOMAKE_VERSION],
5827+[am__api_version='1.10'
5828+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
5829+dnl require some minimum version. Point them to the right macro.
5830+m4_if([$1], [1.10], [],
5831+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
5832+])
5833+
5834+# _AM_AUTOCONF_VERSION(VERSION)
5835+# -----------------------------
5836+# aclocal traces this macro to find the Autoconf version.
5837+# This is a private macro too. Using m4_define simplifies
5838+# the logic in aclocal, which can simply ignore this definition.
5839+m4_define([_AM_AUTOCONF_VERSION], [])
5840
5841 # AM_SET_CURRENT_AUTOMAKE_VERSION
5842 # -------------------------------
5843-# Call AM_AUTOMAKE_VERSION so it can be traced.
5844+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
5845 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
5846 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
5847- [AM_AUTOMAKE_VERSION([1.9.5])])
5848+[AM_AUTOMAKE_VERSION([1.10])dnl
5849+_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
5850
5851 # AM_AUX_DIR_EXPAND -*- Autoconf -*-
5852
5853@@ -85,14 +105,14 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
5854
5855 # AM_CONDITIONAL -*- Autoconf -*-
5856
5857-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
5858+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
5859 # Free Software Foundation, Inc.
5860 #
5861 # This file is free software; the Free Software Foundation
5862 # gives unlimited permission to copy and/or distribute it,
5863 # with or without modifications, as long as this notice is preserved.
5864
5865-# serial 7
5866+# serial 8
5867
5868 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
5869 # -------------------------------------
5870@@ -101,8 +121,10 @@ AC_DEFUN([AM_CONDITIONAL],
5871 [AC_PREREQ(2.52)dnl
5872 ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
5873 [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
5874-AC_SUBST([$1_TRUE])
5875-AC_SUBST([$1_FALSE])
5876+AC_SUBST([$1_TRUE])dnl
5877+AC_SUBST([$1_FALSE])dnl
5878+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
5879+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
5880 if $2; then
5881 $1_TRUE=
5882 $1_FALSE='#'
5883@@ -116,15 +138,14 @@ AC_CONFIG_COMMANDS_PRE(
5884 Usually this means the macro was only invoked conditionally.]])
5885 fi])])
5886
5887-
5888-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
5889+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
5890 # Free Software Foundation, Inc.
5891 #
5892 # This file is free software; the Free Software Foundation
5893 # gives unlimited permission to copy and/or distribute it,
5894 # with or without modifications, as long as this notice is preserved.
5895
5896-# serial 8
5897+# serial 9
5898
5899 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
5900 # written in clear, in which case automake, when reading aclocal.m4,
5901@@ -152,6 +173,7 @@ AC_REQUIRE([AM_DEP_TRACK])dnl
5902 ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
5903 [$1], CXX, [depcc="$CXX" am_compiler_list=],
5904 [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
5905+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
5906 [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
5907 [depcc="$$1" am_compiler_list=])
5908
5909@@ -217,6 +239,7 @@ AC_CACHE_CHECK([dependency style of $depcc],
5910 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
5911 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
5912 >/dev/null 2>conftest.err &&
5913+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
5914 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
5915 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
5916 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
5917@@ -269,7 +292,8 @@ if test "x$enable_dependency_tracking" != xno; then
5918 AMDEPBACKSLASH='\'
5919 fi
5920 AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
5921-AC_SUBST([AMDEPBACKSLASH])
5922+AC_SUBST([AMDEPBACKSLASH])dnl
5923+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
5924 ])
5925
5926 # Generate code to set up dependency tracking. -*- Autoconf -*-
5927@@ -294,8 +318,9 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
5928 # some people rename them; so instead we look at the file content.
5929 # Grep'ing the first line is not enough: some people post-process
5930 # each Makefile.in and add a new line on top of each file to say so.
5931- # So let's grep whole file.
5932- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
5933+ # Grep'ing the whole file is not good either: AIX grep has a line
5934+ # limit of 2048, but all sed's we know have understand at least 4000.
5935+ if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
5936 dirpart=`AS_DIRNAME("$mf")`
5937 else
5938 continue
5939@@ -342,8 +367,8 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
5940
5941 # Do all the work for Automake. -*- Autoconf -*-
5942
5943-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
5944-# Free Software Foundation, Inc.
5945+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
5946+# 2005, 2006 Free Software Foundation, Inc.
5947 #
5948 # This file is free software; the Free Software Foundation
5949 # gives unlimited permission to copy and/or distribute it,
5950@@ -366,16 +391,20 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
5951 # arguments mandatory, and then we can depend on a new Autoconf
5952 # release and drop the old call support.
5953 AC_DEFUN([AM_INIT_AUTOMAKE],
5954-[AC_PREREQ([2.58])dnl
5955+[AC_PREREQ([2.60])dnl
5956 dnl Autoconf wants to disallow AM_ names. We explicitly allow
5957 dnl the ones we care about.
5958 m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
5959 AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
5960 AC_REQUIRE([AC_PROG_INSTALL])dnl
5961-# test to see if srcdir already configured
5962-if test "`cd $srcdir && pwd`" != "`pwd`" &&
5963- test -f $srcdir/config.status; then
5964- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
5965+if test "`cd $srcdir && pwd`" != "`pwd`"; then
5966+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
5967+ # is not polluted with repeated "-I."
5968+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
5969+ # test to see if srcdir already configured
5970+ if test -f $srcdir/config.status; then
5971+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
5972+ fi
5973 fi
5974
5975 # test whether we have cygpath
5976@@ -395,6 +424,9 @@ m4_ifval([$2],
5977 AC_SUBST([PACKAGE], [$1])dnl
5978 AC_SUBST([VERSION], [$2])],
5979 [_AM_SET_OPTIONS([$1])dnl
5980+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
5981+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
5982+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
5983 AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
5984 AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
5985
5986@@ -430,6 +462,10 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
5987 [_AM_DEPENDENCIES(CXX)],
5988 [define([AC_PROG_CXX],
5989 defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
5990+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
5991+ [_AM_DEPENDENCIES(OBJC)],
5992+ [define([AC_PROG_OBJC],
5993+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
5994 ])
5995 ])
5996
5997@@ -465,7 +501,7 @@ echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
5998 # Define $install_sh.
5999 AC_DEFUN([AM_PROG_INSTALL_SH],
6000 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6001-install_sh=${install_sh-"$am_aux_dir/install-sh"}
6002+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
6003 AC_SUBST(install_sh)])
6004
6005 # Copyright (C) 2003, 2005 Free Software Foundation, Inc.
6006@@ -543,14 +579,14 @@ rm -f confinc confmf
6007
6008 # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
6009
6010-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
6011+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
6012 # Free Software Foundation, Inc.
6013 #
6014 # This file is free software; the Free Software Foundation
6015 # gives unlimited permission to copy and/or distribute it,
6016 # with or without modifications, as long as this notice is preserved.
6017
6018-# serial 4
6019+# serial 5
6020
6021 # AM_MISSING_PROG(NAME, PROGRAM)
6022 # ------------------------------
6023@@ -566,6 +602,7 @@ AC_SUBST($1)])
6024 # If it does, set am_missing_run to use it, otherwise, to nothing.
6025 AC_DEFUN([AM_MISSING_HAS_RUN],
6026 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
6027+AC_REQUIRE_AUX_FILE([missing])dnl
6028 test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
6029 # Use eval to expand $SHELL
6030 if eval "$MISSING --run true"; then
6031@@ -576,7 +613,7 @@ else
6032 fi
6033 ])
6034
6035-# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
6036+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
6037 #
6038 # This file is free software; the Free Software Foundation
6039 # gives unlimited permission to copy and/or distribute it,
6040@@ -584,60 +621,23 @@ fi
6041
6042 # AM_PROG_MKDIR_P
6043 # ---------------
6044-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
6045-#
6046-# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
6047-# created by `make install' are always world readable, even if the
6048-# installer happens to have an overly restrictive umask (e.g. 077).
6049-# This was a mistake. There are at least two reasons why we must not
6050-# use `-m 0755':
6051-# - it causes special bits like SGID to be ignored,
6052-# - it may be too restrictive (some setups expect 775 directories).
6053-#
6054-# Do not use -m 0755 and let people choose whatever they expect by
6055-# setting umask.
6056-#
6057-# We cannot accept any implementation of `mkdir' that recognizes `-p'.
6058-# Some implementations (such as Solaris 8's) are not thread-safe: if a
6059-# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
6060-# concurrently, both version can detect that a/ is missing, but only
6061-# one can create it and the other will error out. Consequently we
6062-# restrict ourselves to GNU make (using the --version option ensures
6063-# this.)
6064+# Check for `mkdir -p'.
6065 AC_DEFUN([AM_PROG_MKDIR_P],
6066-[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
6067- # We used to keeping the `.' as first argument, in order to
6068- # allow $(mkdir_p) to be used without argument. As in
6069- # $(mkdir_p) $(somedir)
6070- # where $(somedir) is conditionally defined. However this is wrong
6071- # for two reasons:
6072- # 1. if the package is installed by a user who cannot write `.'
6073- # make install will fail,
6074- # 2. the above comment should most certainly read
6075- # $(mkdir_p) $(DESTDIR)$(somedir)
6076- # so it does not work when $(somedir) is undefined and
6077- # $(DESTDIR) is not.
6078- # To support the latter case, we have to write
6079- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
6080- # so the `.' trick is pointless.
6081- mkdir_p='mkdir -p --'
6082-else
6083- # On NextStep and OpenStep, the `mkdir' command does not
6084- # recognize any option. It will interpret all options as
6085- # directories to create, and then abort because `.' already
6086- # exists.
6087- for d in ./-p ./--version;
6088- do
6089- test -d $d && rmdir $d
6090- done
6091- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
6092- if test -f "$ac_aux_dir/mkinstalldirs"; then
6093- mkdir_p='$(mkinstalldirs)'
6094- else
6095- mkdir_p='$(install_sh) -d'
6096- fi
6097-fi
6098-AC_SUBST([mkdir_p])])
6099+[AC_PREREQ([2.60])dnl
6100+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
6101+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
6102+dnl while keeping a definition of mkdir_p for backward compatibility.
6103+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
6104+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
6105+dnl Makefile.ins that do not define MKDIR_P, so we do our own
6106+dnl adjustment using top_builddir (which is defined more often than
6107+dnl MKDIR_P).
6108+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
6109+case $mkdir_p in
6110+ [[\\/$]]* | ?:[[\\/]]*) ;;
6111+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
6112+esac
6113+])
6114
6115 # Helper functions for option handling. -*- Autoconf -*-
6116
6117@@ -749,9 +749,21 @@ dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
6118 if test "$cross_compiling" != no; then
6119 AC_CHECK_TOOL([STRIP], [strip], :)
6120 fi
6121-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
6122+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
6123 AC_SUBST([INSTALL_STRIP_PROGRAM])])
6124
6125+# Copyright (C) 2006 Free Software Foundation, Inc.
6126+#
6127+# This file is free software; the Free Software Foundation
6128+# gives unlimited permission to copy and/or distribute it,
6129+# with or without modifications, as long as this notice is preserved.
6130+
6131+# _AM_SUBST_NOTMAKE(VARIABLE)
6132+# ---------------------------
6133+# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
6134+# This macro is traced by Automake.
6135+AC_DEFUN([_AM_SUBST_NOTMAKE])
6136+
6137 # Check how to create a tarball. -*- Autoconf -*-
6138
6139 # Copyright (C) 2004, 2005 Free Software Foundation, Inc.
6140diff --git a/config.h.in b/config.h.in
6141index 02523bc..3d94d1d 100644
6142--- a/config.h.in
6143+++ b/config.h.in
6144@@ -3,12 +3,21 @@
6145 /* Define to 1 if you have the `bsearch' function. */
6146 #undef HAVE_BSEARCH
6147
6148+/* Define to 1 if you have the `fnmatch' function. */
6149+#undef HAVE_FNMATCH
6150+
6151 /* Define to 1 if you have the `getpwnam' function. */
6152 #undef HAVE_GETPWNAM
6153
6154 /* Define to 1 if you have the `getrlimit' function. */
6155 #undef HAVE_GETRLIMIT
6156
6157+/* Define to 1 if you have the `glob' function. */
6158+#undef HAVE_GLOB
6159+
6160+/* Define to 1 if you have the `imaxdiv' function. */
6161+#undef HAVE_IMAXDIV
6162+
6163 /* Define to 1 if you have the <inttypes.h> header file. */
6164 #undef HAVE_INTTYPES_H
6165
6166diff --git a/configure b/configure
6167index 8290284..7380665 100755
6168--- a/configure
6169+++ b/configure
6170@@ -1,25 +1,54 @@
6171 #! /bin/sh
6172 # Guess values for system-dependent variables and create Makefiles.
6173-# Generated by GNU Autoconf 2.59 for dash 0.5.4.
6174+# Generated by GNU Autoconf 2.61 for dash 0.5.4.
6175 #
6176-# Copyright (C) 2003 Free Software Foundation, Inc.
6177+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
6178+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
6179 # This configure script is free software; the Free Software Foundation
6180 # gives unlimited permission to copy, distribute and modify it.
6181 ## --------------------- ##
6182 ## M4sh Initialization. ##
6183 ## --------------------- ##
6184
6185-# Be Bourne compatible
6186+# Be more Bourne compatible
6187+DUALCASE=1; export DUALCASE # for MKS sh
6188 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
6189 emulate sh
6190 NULLCMD=:
6191 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
6192 # is contrary to our usage. Disable this feature.
6193 alias -g '${1+"$@"}'='"$@"'
6194-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
6195- set -o posix
6196+ setopt NO_GLOB_SUBST
6197+else
6198+ case `(set -o) 2>/dev/null` in
6199+ *posix*) set -o posix ;;
6200+esac
6201+
6202+fi
6203+
6204+
6205+
6206+
6207+# PATH needs CR
6208+# Avoid depending upon Character Ranges.
6209+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
6210+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
6211+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
6212+as_cr_digits='0123456789'
6213+as_cr_alnum=$as_cr_Letters$as_cr_digits
6214+
6215+# The user is always right.
6216+if test "${PATH_SEPARATOR+set}" != set; then
6217+ echo "#! /bin/sh" >conf$$.sh
6218+ echo "exit 0" >>conf$$.sh
6219+ chmod +x conf$$.sh
6220+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
6221+ PATH_SEPARATOR=';'
6222+ else
6223+ PATH_SEPARATOR=:
6224+ fi
6225+ rm -f conf$$.sh
6226 fi
6227-DUALCASE=1; export DUALCASE # for MKS sh
6228
6229 # Support unset when possible.
6230 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
6231@@ -29,8 +58,43 @@ else
6232 fi
6233
6234
6235+# IFS
6236+# We need space, tab and new line, in precisely that order. Quoting is
6237+# there to prevent editors from complaining about space-tab.
6238+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
6239+# splitting by setting IFS to empty value.)
6240+as_nl='
6241+'
6242+IFS=" "" $as_nl"
6243+
6244+# Find who we are. Look in the path if we contain no directory separator.
6245+case $0 in
6246+ *[\\/]* ) as_myself=$0 ;;
6247+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6248+for as_dir in $PATH
6249+do
6250+ IFS=$as_save_IFS
6251+ test -z "$as_dir" && as_dir=.
6252+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
6253+done
6254+IFS=$as_save_IFS
6255+
6256+ ;;
6257+esac
6258+# We did not find ourselves, most probably we were run as `sh COMMAND'
6259+# in which case we are not to be found in the path.
6260+if test "x$as_myself" = x; then
6261+ as_myself=$0
6262+fi
6263+if test ! -f "$as_myself"; then
6264+ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
6265+ { (exit 1); exit 1; }
6266+fi
6267+
6268 # Work around bugs in pre-3.0 UWIN ksh.
6269-$as_unset ENV MAIL MAILPATH
6270+for as_var in ENV MAIL MAILPATH
6271+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
6272+done
6273 PS1='$ '
6274 PS2='> '
6275 PS4='+ '
6276@@ -44,18 +108,19 @@ do
6277 if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
6278 eval $as_var=C; export $as_var
6279 else
6280- $as_unset $as_var
6281+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
6282 fi
6283 done
6284
6285 # Required to use basename.
6286-if expr a : '\(a\)' >/dev/null 2>&1; then
6287+if expr a : '\(a\)' >/dev/null 2>&1 &&
6288+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
6289 as_expr=expr
6290 else
6291 as_expr=false
6292 fi
6293
6294-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
6295+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
6296 as_basename=basename
6297 else
6298 as_basename=false
6299@@ -63,157 +128,388 @@ fi
6300
6301
6302 # Name of the executable.
6303-as_me=`$as_basename "$0" ||
6304+as_me=`$as_basename -- "$0" ||
6305 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
6306 X"$0" : 'X\(//\)$' \| \
6307- X"$0" : 'X\(/\)$' \| \
6308- . : '\(.\)' 2>/dev/null ||
6309+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
6310 echo X/"$0" |
6311- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
6312- /^X\/\(\/\/\)$/{ s//\1/; q; }
6313- /^X\/\(\/\).*/{ s//\1/; q; }
6314- s/.*/./; q'`
6315+ sed '/^.*\/\([^/][^/]*\)\/*$/{
6316+ s//\1/
6317+ q
6318+ }
6319+ /^X\/\(\/\/\)$/{
6320+ s//\1/
6321+ q
6322+ }
6323+ /^X\/\(\/\).*/{
6324+ s//\1/
6325+ q
6326+ }
6327+ s/.*/./; q'`
6328
6329+# CDPATH.
6330+$as_unset CDPATH
6331
6332-# PATH needs CR, and LINENO needs CR and PATH.
6333-# Avoid depending upon Character Ranges.
6334-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
6335-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
6336-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
6337-as_cr_digits='0123456789'
6338-as_cr_alnum=$as_cr_Letters$as_cr_digits
6339
6340-# The user is always right.
6341-if test "${PATH_SEPARATOR+set}" != set; then
6342- echo "#! /bin/sh" >conf$$.sh
6343- echo "exit 0" >>conf$$.sh
6344- chmod +x conf$$.sh
6345- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
6346- PATH_SEPARATOR=';'
6347- else
6348- PATH_SEPARATOR=:
6349- fi
6350- rm -f conf$$.sh
6351+if test "x$CONFIG_SHELL" = x; then
6352+ if (eval ":") 2>/dev/null; then
6353+ as_have_required=yes
6354+else
6355+ as_have_required=no
6356 fi
6357
6358+ if test $as_have_required = yes && (eval ":
6359+(as_func_return () {
6360+ (exit \$1)
6361+}
6362+as_func_success () {
6363+ as_func_return 0
6364+}
6365+as_func_failure () {
6366+ as_func_return 1
6367+}
6368+as_func_ret_success () {
6369+ return 0
6370+}
6371+as_func_ret_failure () {
6372+ return 1
6373+}
6374
6375- as_lineno_1=$LINENO
6376- as_lineno_2=$LINENO
6377- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
6378- test "x$as_lineno_1" != "x$as_lineno_2" &&
6379- test "x$as_lineno_3" = "x$as_lineno_2" || {
6380- # Find who we are. Look in the path if we contain no path at all
6381- # relative or not.
6382- case $0 in
6383- *[\\/]* ) as_myself=$0 ;;
6384- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6385-for as_dir in $PATH
6386-do
6387- IFS=$as_save_IFS
6388- test -z "$as_dir" && as_dir=.
6389- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
6390-done
6391+exitcode=0
6392+if as_func_success; then
6393+ :
6394+else
6395+ exitcode=1
6396+ echo as_func_success failed.
6397+fi
6398
6399- ;;
6400- esac
6401- # We did not find ourselves, most probably we were run as `sh COMMAND'
6402- # in which case we are not to be found in the path.
6403- if test "x$as_myself" = x; then
6404- as_myself=$0
6405- fi
6406- if test ! -f "$as_myself"; then
6407- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
6408- { (exit 1); exit 1; }; }
6409- fi
6410- case $CONFIG_SHELL in
6411- '')
6412+if as_func_failure; then
6413+ exitcode=1
6414+ echo as_func_failure succeeded.
6415+fi
6416+
6417+if as_func_ret_success; then
6418+ :
6419+else
6420+ exitcode=1
6421+ echo as_func_ret_success failed.
6422+fi
6423+
6424+if as_func_ret_failure; then
6425+ exitcode=1
6426+ echo as_func_ret_failure succeeded.
6427+fi
6428+
6429+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
6430+ :
6431+else
6432+ exitcode=1
6433+ echo positional parameters were not saved.
6434+fi
6435+
6436+test \$exitcode = 0) || { (exit 1); exit 1; }
6437+
6438+(
6439+ as_lineno_1=\$LINENO
6440+ as_lineno_2=\$LINENO
6441+ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
6442+ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
6443+") 2> /dev/null; then
6444+ :
6445+else
6446+ as_candidate_shells=
6447 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
6448 for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
6449 do
6450 IFS=$as_save_IFS
6451 test -z "$as_dir" && as_dir=.
6452- for as_base in sh bash ksh sh5; do
6453- case $as_dir in
6454+ case $as_dir in
6455 /*)
6456- if ("$as_dir/$as_base" -c '
6457+ for as_base in sh bash ksh sh5; do
6458+ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
6459+ done;;
6460+ esac
6461+done
6462+IFS=$as_save_IFS
6463+
6464+
6465+ for as_shell in $as_candidate_shells $SHELL; do
6466+ # Try only shells that exist, to save several forks.
6467+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
6468+ { ("$as_shell") 2> /dev/null <<\_ASEOF
6469+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
6470+ emulate sh
6471+ NULLCMD=:
6472+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
6473+ # is contrary to our usage. Disable this feature.
6474+ alias -g '${1+"$@"}'='"$@"'
6475+ setopt NO_GLOB_SUBST
6476+else
6477+ case `(set -o) 2>/dev/null` in
6478+ *posix*) set -o posix ;;
6479+esac
6480+
6481+fi
6482+
6483+
6484+:
6485+_ASEOF
6486+}; then
6487+ CONFIG_SHELL=$as_shell
6488+ as_have_required=yes
6489+ if { "$as_shell" 2> /dev/null <<\_ASEOF
6490+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
6491+ emulate sh
6492+ NULLCMD=:
6493+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
6494+ # is contrary to our usage. Disable this feature.
6495+ alias -g '${1+"$@"}'='"$@"'
6496+ setopt NO_GLOB_SUBST
6497+else
6498+ case `(set -o) 2>/dev/null` in
6499+ *posix*) set -o posix ;;
6500+esac
6501+
6502+fi
6503+
6504+
6505+:
6506+(as_func_return () {
6507+ (exit $1)
6508+}
6509+as_func_success () {
6510+ as_func_return 0
6511+}
6512+as_func_failure () {
6513+ as_func_return 1
6514+}
6515+as_func_ret_success () {
6516+ return 0
6517+}
6518+as_func_ret_failure () {
6519+ return 1
6520+}
6521+
6522+exitcode=0
6523+if as_func_success; then
6524+ :
6525+else
6526+ exitcode=1
6527+ echo as_func_success failed.
6528+fi
6529+
6530+if as_func_failure; then
6531+ exitcode=1
6532+ echo as_func_failure succeeded.
6533+fi
6534+
6535+if as_func_ret_success; then
6536+ :
6537+else
6538+ exitcode=1
6539+ echo as_func_ret_success failed.
6540+fi
6541+
6542+if as_func_ret_failure; then
6543+ exitcode=1
6544+ echo as_func_ret_failure succeeded.
6545+fi
6546+
6547+if ( set x; as_func_ret_success y && test x = "$1" ); then
6548+ :
6549+else
6550+ exitcode=1
6551+ echo positional parameters were not saved.
6552+fi
6553+
6554+test $exitcode = 0) || { (exit 1); exit 1; }
6555+
6556+(
6557 as_lineno_1=$LINENO
6558 as_lineno_2=$LINENO
6559- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
6560 test "x$as_lineno_1" != "x$as_lineno_2" &&
6561- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
6562- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
6563- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
6564- CONFIG_SHELL=$as_dir/$as_base
6565- export CONFIG_SHELL
6566- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
6567- fi;;
6568- esac
6569- done
6570-done
6571-;;
6572- esac
6573+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
6574+
6575+_ASEOF
6576+}; then
6577+ break
6578+fi
6579+
6580+fi
6581+
6582+ done
6583+
6584+ if test "x$CONFIG_SHELL" != x; then
6585+ for as_var in BASH_ENV ENV
6586+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
6587+ done
6588+ export CONFIG_SHELL
6589+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
6590+fi
6591+
6592+
6593+ if test $as_have_required = no; then
6594+ echo This script requires a shell more modern than all the
6595+ echo shells that I found on your system. Please install a
6596+ echo modern shell, or manually run the script under such a
6597+ echo shell if you do have one.
6598+ { (exit 1); exit 1; }
6599+fi
6600+
6601+
6602+fi
6603+
6604+fi
6605+
6606+
6607+
6608+(eval "as_func_return () {
6609+ (exit \$1)
6610+}
6611+as_func_success () {
6612+ as_func_return 0
6613+}
6614+as_func_failure () {
6615+ as_func_return 1
6616+}
6617+as_func_ret_success () {
6618+ return 0
6619+}
6620+as_func_ret_failure () {
6621+ return 1
6622+}
6623+
6624+exitcode=0
6625+if as_func_success; then
6626+ :
6627+else
6628+ exitcode=1
6629+ echo as_func_success failed.
6630+fi
6631+
6632+if as_func_failure; then
6633+ exitcode=1
6634+ echo as_func_failure succeeded.
6635+fi
6636+
6637+if as_func_ret_success; then
6638+ :
6639+else
6640+ exitcode=1
6641+ echo as_func_ret_success failed.
6642+fi
6643+
6644+if as_func_ret_failure; then
6645+ exitcode=1
6646+ echo as_func_ret_failure succeeded.
6647+fi
6648+
6649+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
6650+ :
6651+else
6652+ exitcode=1
6653+ echo positional parameters were not saved.
6654+fi
6655+
6656+test \$exitcode = 0") || {
6657+ echo No shell found that supports shell functions.
6658+ echo Please tell autoconf@gnu.org about your system,
6659+ echo including any error possibly output before this
6660+ echo message
6661+}
6662+
6663+
6664+
6665+ as_lineno_1=$LINENO
6666+ as_lineno_2=$LINENO
6667+ test "x$as_lineno_1" != "x$as_lineno_2" &&
6668+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
6669
6670 # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
6671 # uniformly replaced by the line number. The first 'sed' inserts a
6672- # line-number line before each line; the second 'sed' does the real
6673- # work. The second script uses 'N' to pair each line-number line
6674- # with the numbered line, and appends trailing '-' during
6675- # substitution so that $LINENO is not a special case at line end.
6676+ # line-number line after each line using $LINENO; the second 'sed'
6677+ # does the real work. The second script uses 'N' to pair each
6678+ # line-number line with the line containing $LINENO, and appends
6679+ # trailing '-' during substitution so that $LINENO is not a special
6680+ # case at line end.
6681 # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
6682- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
6683- sed '=' <$as_myself |
6684+ # scripts with optimization help from Paolo Bonzini. Blame Lee
6685+ # E. McMahon (1931-1989) for sed's syntax. :-)
6686+ sed -n '
6687+ p
6688+ /[$]LINENO/=
6689+ ' <$as_myself |
6690 sed '
6691+ s/[$]LINENO.*/&-/
6692+ t lineno
6693+ b
6694+ :lineno
6695 N
6696- s,$,-,
6697- : loop
6698- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
6699+ :loop
6700+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
6701 t loop
6702- s,-$,,
6703- s,^['$as_cr_digits']*\n,,
6704+ s/-\n.*//
6705 ' >$as_me.lineno &&
6706- chmod +x $as_me.lineno ||
6707+ chmod +x "$as_me.lineno" ||
6708 { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
6709 { (exit 1); exit 1; }; }
6710
6711 # Don't try to exec as it changes $[0], causing all sort of problems
6712 # (the dirname of $[0] is not the place where we might find the
6713- # original and so on. Autoconf is especially sensible to this).
6714- . ./$as_me.lineno
6715+ # original and so on. Autoconf is especially sensitive to this).
6716+ . "./$as_me.lineno"
6717 # Exit status is that of the last command.
6718 exit
6719 }
6720
6721
6722-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
6723- *c*,-n*) ECHO_N= ECHO_C='
6724-' ECHO_T=' ' ;;
6725- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
6726- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
6727+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
6728+ as_dirname=dirname
6729+else
6730+ as_dirname=false
6731+fi
6732+
6733+ECHO_C= ECHO_N= ECHO_T=
6734+case `echo -n x` in
6735+-n*)
6736+ case `echo 'x\c'` in
6737+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
6738+ *) ECHO_C='\c';;
6739+ esac;;
6740+*)
6741+ ECHO_N='-n';;
6742 esac
6743
6744-if expr a : '\(a\)' >/dev/null 2>&1; then
6745+if expr a : '\(a\)' >/dev/null 2>&1 &&
6746+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
6747 as_expr=expr
6748 else
6749 as_expr=false
6750 fi
6751
6752 rm -f conf$$ conf$$.exe conf$$.file
6753+if test -d conf$$.dir; then
6754+ rm -f conf$$.dir/conf$$.file
6755+else
6756+ rm -f conf$$.dir
6757+ mkdir conf$$.dir
6758+fi
6759 echo >conf$$.file
6760 if ln -s conf$$.file conf$$ 2>/dev/null; then
6761- # We could just check for DJGPP; but this test a) works b) is more generic
6762- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
6763- if test -f conf$$.exe; then
6764- # Don't use ln at all; we don't have any links
6765+ as_ln_s='ln -s'
6766+ # ... but there are two gotchas:
6767+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
6768+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
6769+ # In both cases, we have to default to `cp -p'.
6770+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
6771 as_ln_s='cp -p'
6772- else
6773- as_ln_s='ln -s'
6774- fi
6775 elif ln conf$$.file conf$$ 2>/dev/null; then
6776 as_ln_s=ln
6777 else
6778 as_ln_s='cp -p'
6779 fi
6780-rm -f conf$$ conf$$.exe conf$$.file
6781+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
6782+rmdir conf$$.dir 2>/dev/null
6783
6784 if mkdir -p . 2>/dev/null; then
6785 as_mkdir_p=:
6786@@ -222,7 +518,28 @@ else
6787 as_mkdir_p=false
6788 fi
6789
6790-as_executable_p="test -f"
6791+if test -x / >/dev/null 2>&1; then
6792+ as_test_x='test -x'
6793+else
6794+ if ls -dL / >/dev/null 2>&1; then
6795+ as_ls_L_option=L
6796+ else
6797+ as_ls_L_option=
6798+ fi
6799+ as_test_x='
6800+ eval sh -c '\''
6801+ if test -d "$1"; then
6802+ test -d "$1/.";
6803+ else
6804+ case $1 in
6805+ -*)set "./$1";;
6806+ esac;
6807+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
6808+ ???[sx]*):;;*)false;;esac;fi
6809+ '\'' sh
6810+ '
6811+fi
6812+as_executable_p=$as_test_x
6813
6814 # Sed expression to map a string onto a valid CPP name.
6815 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
6816@@ -231,39 +548,27 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
6817 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
6818
6819
6820-# IFS
6821-# We need space, tab and new line, in precisely that order.
6822-as_nl='
6823-'
6824-IFS=" $as_nl"
6825-
6826-# CDPATH.
6827-$as_unset CDPATH
6828
6829+exec 7<&0 </dev/null 6>&1
6830
6831 # Name of the host.
6832 # hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
6833 # so uname gets run too.
6834 ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
6835
6836-exec 6>&1
6837-
6838 #
6839 # Initializations.
6840 #
6841 ac_default_prefix=/usr/local
6842+ac_clean_files=
6843 ac_config_libobj_dir=.
6844+LIBOBJS=
6845 cross_compiling=no
6846 subdirs=
6847 MFLAGS=
6848 MAKEFLAGS=
6849 SHELL=${CONFIG_SHELL-/bin/sh}
6850
6851-# Maximum number of lines to put in a shell here document.
6852-# This variable seems obsolete. It should probably be removed, and
6853-# only ac_max_sed_lines should be used.
6854-: ${ac_max_here_lines=38}
6855-
6856 # Identity of this package.
6857 PACKAGE_NAME='dash'
6858 PACKAGE_TARNAME='dash'
6859@@ -275,42 +580,135 @@ ac_unique_file="src/main.c"
6860 # Factoring default headers for most tests.
6861 ac_includes_default="\
6862 #include <stdio.h>
6863-#if HAVE_SYS_TYPES_H
6864+#ifdef HAVE_SYS_TYPES_H
6865 # include <sys/types.h>
6866 #endif
6867-#if HAVE_SYS_STAT_H
6868+#ifdef HAVE_SYS_STAT_H
6869 # include <sys/stat.h>
6870 #endif
6871-#if STDC_HEADERS
6872+#ifdef STDC_HEADERS
6873 # include <stdlib.h>
6874 # include <stddef.h>
6875 #else
6876-# if HAVE_STDLIB_H
6877+# ifdef HAVE_STDLIB_H
6878 # include <stdlib.h>
6879 # endif
6880 #endif
6881-#if HAVE_STRING_H
6882-# if !STDC_HEADERS && HAVE_MEMORY_H
6883+#ifdef HAVE_STRING_H
6884+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
6885 # include <memory.h>
6886 # endif
6887 # include <string.h>
6888 #endif
6889-#if HAVE_STRINGS_H
6890+#ifdef HAVE_STRINGS_H
6891 # include <strings.h>
6892 #endif
6893-#if HAVE_INTTYPES_H
6894+#ifdef HAVE_INTTYPES_H
6895 # include <inttypes.h>
6896-#else
6897-# if HAVE_STDINT_H
6898-# include <stdint.h>
6899-# endif
6900 #endif
6901-#if HAVE_UNISTD_H
6902+#ifdef HAVE_STDINT_H
6903+# include <stdint.h>
6904+#endif
6905+#ifdef HAVE_UNISTD_H
6906 # include <unistd.h>
6907 #endif"
6908
6909-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 INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE YACC CC_FOR_BUILD CPP EGREP LIBOBJS LTLIBOBJS'
6910+ac_subst_vars='SHELL
6911+PATH_SEPARATOR
6912+PACKAGE_NAME
6913+PACKAGE_TARNAME
6914+PACKAGE_VERSION
6915+PACKAGE_STRING
6916+PACKAGE_BUGREPORT
6917+exec_prefix
6918+prefix
6919+program_transform_name
6920+bindir
6921+sbindir
6922+libexecdir
6923+datarootdir
6924+datadir
6925+sysconfdir
6926+sharedstatedir
6927+localstatedir
6928+includedir
6929+oldincludedir
6930+docdir
6931+infodir
6932+htmldir
6933+dvidir
6934+pdfdir
6935+psdir
6936+libdir
6937+localedir
6938+mandir
6939+DEFS
6940+ECHO_C
6941+ECHO_N
6942+ECHO_T
6943+LIBS
6944+build_alias
6945+host_alias
6946+target_alias
6947+INSTALL_PROGRAM
6948+INSTALL_SCRIPT
6949+INSTALL_DATA
6950+am__isrc
6951+CYGPATH_W
6952+PACKAGE
6953+VERSION
6954+ACLOCAL
6955+AUTOCONF
6956+AUTOMAKE
6957+AUTOHEADER
6958+MAKEINFO
6959+install_sh
6960+STRIP
6961+INSTALL_STRIP_PROGRAM
6962+mkdir_p
6963+AWK
6964+SET_MAKE
6965+am__leading_dot
6966+AMTAR
6967+am__tar
6968+am__untar
6969+CC
6970+CFLAGS
6971+LDFLAGS
6972+CPPFLAGS
6973+ac_ct_CC
6974+EXEEXT
6975+OBJEXT
6976+DEPDIR
6977+am__include
6978+am__quote
6979+AMDEP_TRUE
6980+AMDEP_FALSE
6981+AMDEPBACKSLASH
6982+CCDEPMODE
6983+am__fastdepCC_TRUE
6984+am__fastdepCC_FALSE
6985+YACC
6986+YFLAGS
6987+CC_FOR_BUILD
6988+CPP
6989+GREP
6990+EGREP
6991+LIBOBJS
6992+LTLIBOBJS'
6993 ac_subst_files=''
6994+ ac_precious_vars='build_alias
6995+host_alias
6996+target_alias
6997+CC
6998+CFLAGS
6999+LDFLAGS
7000+LIBS
7001+CPPFLAGS
7002+YACC
7003+YFLAGS
7004+CPP'
7005+
7006
7007 # Initialize some variables set by options.
7008 ac_init_help=
7009@@ -337,34 +735,48 @@ x_libraries=NONE
7010 # and all the variables that are supposed to be based on exec_prefix
7011 # by default will actually change.
7012 # Use braces instead of parens because sh, perl, etc. also accept them.
7013+# (The list follows the same order as the GNU Coding Standards.)
7014 bindir='${exec_prefix}/bin'
7015 sbindir='${exec_prefix}/sbin'
7016 libexecdir='${exec_prefix}/libexec'
7017-datadir='${prefix}/share'
7018+datarootdir='${prefix}/share'
7019+datadir='${datarootdir}'
7020 sysconfdir='${prefix}/etc'
7021 sharedstatedir='${prefix}/com'
7022 localstatedir='${prefix}/var'
7023-libdir='${exec_prefix}/lib'
7024 includedir='${prefix}/include'
7025 oldincludedir='/usr/include'
7026-infodir='${prefix}/info'
7027-mandir='${prefix}/man'
7028+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
7029+infodir='${datarootdir}/info'
7030+htmldir='${docdir}'
7031+dvidir='${docdir}'
7032+pdfdir='${docdir}'
7033+psdir='${docdir}'
7034+libdir='${exec_prefix}/lib'
7035+localedir='${datarootdir}/locale'
7036+mandir='${datarootdir}/man'
7037
7038 ac_prev=
7039+ac_dashdash=
7040 for ac_option
7041 do
7042 # If the previous option needs an argument, assign it.
7043 if test -n "$ac_prev"; then
7044- eval "$ac_prev=\$ac_option"
7045+ eval $ac_prev=\$ac_option
7046 ac_prev=
7047 continue
7048 fi
7049
7050- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
7051+ case $ac_option in
7052+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
7053+ *) ac_optarg=yes ;;
7054+ esac
7055
7056 # Accept the important Cygnus configure options, so we can diagnose typos.
7057
7058- case $ac_option in
7059+ case $ac_dashdash$ac_option in
7060+ --)
7061+ ac_dashdash=yes ;;
7062
7063 -bindir | --bindir | --bindi | --bind | --bin | --bi)
7064 ac_prev=bindir ;;
7065@@ -386,33 +798,45 @@ do
7066 --config-cache | -C)
7067 cache_file=config.cache ;;
7068
7069- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
7070+ -datadir | --datadir | --datadi | --datad)
7071 ac_prev=datadir ;;
7072- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
7073- | --da=*)
7074+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
7075 datadir=$ac_optarg ;;
7076
7077+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
7078+ | --dataroo | --dataro | --datar)
7079+ ac_prev=datarootdir ;;
7080+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
7081+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
7082+ datarootdir=$ac_optarg ;;
7083+
7084 -disable-* | --disable-*)
7085 ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
7086 # Reject names that are not valid shell variable names.
7087- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
7088+ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
7089 { echo "$as_me: error: invalid feature name: $ac_feature" >&2
7090 { (exit 1); exit 1; }; }
7091- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
7092- eval "enable_$ac_feature=no" ;;
7093+ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
7094+ eval enable_$ac_feature=no ;;
7095+
7096+ -docdir | --docdir | --docdi | --doc | --do)
7097+ ac_prev=docdir ;;
7098+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
7099+ docdir=$ac_optarg ;;
7100+
7101+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
7102+ ac_prev=dvidir ;;
7103+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
7104+ dvidir=$ac_optarg ;;
7105
7106 -enable-* | --enable-*)
7107 ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
7108 # Reject names that are not valid shell variable names.
7109- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
7110+ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
7111 { echo "$as_me: error: invalid feature name: $ac_feature" >&2
7112 { (exit 1); exit 1; }; }
7113- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
7114- case $ac_option in
7115- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
7116- *) ac_optarg=yes ;;
7117- esac
7118- eval "enable_$ac_feature='$ac_optarg'" ;;
7119+ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
7120+ eval enable_$ac_feature=\$ac_optarg ;;
7121
7122 -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
7123 | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
7124@@ -439,6 +863,12 @@ do
7125 -host=* | --host=* | --hos=* | --ho=*)
7126 host_alias=$ac_optarg ;;
7127
7128+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
7129+ ac_prev=htmldir ;;
7130+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
7131+ | --ht=*)
7132+ htmldir=$ac_optarg ;;
7133+
7134 -includedir | --includedir | --includedi | --included | --include \
7135 | --includ | --inclu | --incl | --inc)
7136 ac_prev=includedir ;;
7137@@ -463,13 +893,16 @@ do
7138 | --libexe=* | --libex=* | --libe=*)
7139 libexecdir=$ac_optarg ;;
7140
7141+ -localedir | --localedir | --localedi | --localed | --locale)
7142+ ac_prev=localedir ;;
7143+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
7144+ localedir=$ac_optarg ;;
7145+
7146 -localstatedir | --localstatedir | --localstatedi | --localstated \
7147- | --localstate | --localstat | --localsta | --localst \
7148- | --locals | --local | --loca | --loc | --lo)
7149+ | --localstate | --localstat | --localsta | --localst | --locals)
7150 ac_prev=localstatedir ;;
7151 -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
7152- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
7153- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
7154+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
7155 localstatedir=$ac_optarg ;;
7156
7157 -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
7158@@ -534,6 +967,16 @@ do
7159 | --progr-tra=* | --program-tr=* | --program-t=*)
7160 program_transform_name=$ac_optarg ;;
7161
7162+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
7163+ ac_prev=pdfdir ;;
7164+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
7165+ pdfdir=$ac_optarg ;;
7166+
7167+ -psdir | --psdir | --psdi | --psd | --ps)
7168+ ac_prev=psdir ;;
7169+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
7170+ psdir=$ac_optarg ;;
7171+
7172 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
7173 | -silent | --silent | --silen | --sile | --sil)
7174 silent=yes ;;
7175@@ -586,24 +1029,20 @@ do
7176 -with-* | --with-*)
7177 ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
7178 # Reject names that are not valid shell variable names.
7179- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
7180+ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
7181 { echo "$as_me: error: invalid package name: $ac_package" >&2
7182 { (exit 1); exit 1; }; }
7183- ac_package=`echo $ac_package| sed 's/-/_/g'`
7184- case $ac_option in
7185- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
7186- *) ac_optarg=yes ;;
7187- esac
7188- eval "with_$ac_package='$ac_optarg'" ;;
7189+ ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
7190+ eval with_$ac_package=\$ac_optarg ;;
7191
7192 -without-* | --without-*)
7193 ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
7194 # Reject names that are not valid shell variable names.
7195- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
7196+ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
7197 { echo "$as_me: error: invalid package name: $ac_package" >&2
7198 { (exit 1); exit 1; }; }
7199- ac_package=`echo $ac_package | sed 's/-/_/g'`
7200- eval "with_$ac_package=no" ;;
7201+ ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
7202+ eval with_$ac_package=no ;;
7203
7204 --x)
7205 # Obsolete; use --with-x.
7206@@ -634,8 +1073,7 @@ Try \`$0 --help' for more information." >&2
7207 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
7208 { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
7209 { (exit 1); exit 1; }; }
7210- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
7211- eval "$ac_envvar='$ac_optarg'"
7212+ eval $ac_envvar=\$ac_optarg
7213 export $ac_envvar ;;
7214
7215 *)
7216@@ -655,27 +1093,19 @@ if test -n "$ac_prev"; then
7217 { (exit 1); exit 1; }; }
7218 fi
7219
7220-# Be sure to have absolute paths.
7221-for ac_var in exec_prefix prefix
7222-do
7223- eval ac_val=$`echo $ac_var`
7224- case $ac_val in
7225- [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
7226- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
7227- { (exit 1); exit 1; }; };;
7228- esac
7229-done
7230-
7231-# Be sure to have absolute paths.
7232-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
7233- localstatedir libdir includedir oldincludedir infodir mandir
7234+# Be sure to have absolute directory names.
7235+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
7236+ datadir sysconfdir sharedstatedir localstatedir includedir \
7237+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
7238+ libdir localedir mandir
7239 do
7240- eval ac_val=$`echo $ac_var`
7241+ eval ac_val=\$$ac_var
7242 case $ac_val in
7243- [\\/$]* | ?:[\\/]* ) ;;
7244- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
7245- { (exit 1); exit 1; }; };;
7246+ [\\/$]* | ?:[\\/]* ) continue;;
7247+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
7248 esac
7249+ { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
7250+ { (exit 1); exit 1; }; }
7251 done
7252
7253 # There might be people who depend on the old broken behavior: `$host'
7254@@ -702,74 +1132,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
7255 test "$silent" = yes && exec 6>/dev/null
7256
7257
7258+ac_pwd=`pwd` && test -n "$ac_pwd" &&
7259+ac_ls_di=`ls -di .` &&
7260+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
7261+ { echo "$as_me: error: Working directory cannot be determined" >&2
7262+ { (exit 1); exit 1; }; }
7263+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
7264+ { echo "$as_me: error: pwd does not report name of working directory" >&2
7265+ { (exit 1); exit 1; }; }
7266+
7267+
7268 # Find the source files, if location was not specified.
7269 if test -z "$srcdir"; then
7270 ac_srcdir_defaulted=yes
7271- # Try the directory containing this script, then its parent.
7272- ac_confdir=`(dirname "$0") 2>/dev/null ||
7273+ # Try the directory containing this script, then the parent directory.
7274+ ac_confdir=`$as_dirname -- "$0" ||
7275 $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
7276 X"$0" : 'X\(//\)[^/]' \| \
7277 X"$0" : 'X\(//\)$' \| \
7278- X"$0" : 'X\(/\)' \| \
7279- . : '\(.\)' 2>/dev/null ||
7280+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
7281 echo X"$0" |
7282- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
7283- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
7284- /^X\(\/\/\)$/{ s//\1/; q; }
7285- /^X\(\/\).*/{ s//\1/; q; }
7286- s/.*/./; q'`
7287+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
7288+ s//\1/
7289+ q
7290+ }
7291+ /^X\(\/\/\)[^/].*/{
7292+ s//\1/
7293+ q
7294+ }
7295+ /^X\(\/\/\)$/{
7296+ s//\1/
7297+ q
7298+ }
7299+ /^X\(\/\).*/{
7300+ s//\1/
7301+ q
7302+ }
7303+ s/.*/./; q'`
7304 srcdir=$ac_confdir
7305- if test ! -r $srcdir/$ac_unique_file; then
7306+ if test ! -r "$srcdir/$ac_unique_file"; then
7307 srcdir=..
7308 fi
7309 else
7310 ac_srcdir_defaulted=no
7311 fi
7312-if test ! -r $srcdir/$ac_unique_file; then
7313- if test "$ac_srcdir_defaulted" = yes; then
7314- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
7315- { (exit 1); exit 1; }; }
7316- else
7317- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
7318+if test ! -r "$srcdir/$ac_unique_file"; then
7319+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
7320+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
7321 { (exit 1); exit 1; }; }
7322- fi
7323 fi
7324-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
7325- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
7326+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
7327+ac_abs_confdir=`(
7328+ cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
7329 { (exit 1); exit 1; }; }
7330-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
7331-ac_env_build_alias_set=${build_alias+set}
7332-ac_env_build_alias_value=$build_alias
7333-ac_cv_env_build_alias_set=${build_alias+set}
7334-ac_cv_env_build_alias_value=$build_alias
7335-ac_env_host_alias_set=${host_alias+set}
7336-ac_env_host_alias_value=$host_alias
7337-ac_cv_env_host_alias_set=${host_alias+set}
7338-ac_cv_env_host_alias_value=$host_alias
7339-ac_env_target_alias_set=${target_alias+set}
7340-ac_env_target_alias_value=$target_alias
7341-ac_cv_env_target_alias_set=${target_alias+set}
7342-ac_cv_env_target_alias_value=$target_alias
7343-ac_env_CC_set=${CC+set}
7344-ac_env_CC_value=$CC
7345-ac_cv_env_CC_set=${CC+set}
7346-ac_cv_env_CC_value=$CC
7347-ac_env_CFLAGS_set=${CFLAGS+set}
7348-ac_env_CFLAGS_value=$CFLAGS
7349-ac_cv_env_CFLAGS_set=${CFLAGS+set}
7350-ac_cv_env_CFLAGS_value=$CFLAGS
7351-ac_env_LDFLAGS_set=${LDFLAGS+set}
7352-ac_env_LDFLAGS_value=$LDFLAGS
7353-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
7354-ac_cv_env_LDFLAGS_value=$LDFLAGS
7355-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
7356-ac_env_CPPFLAGS_value=$CPPFLAGS
7357-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
7358-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
7359-ac_env_CPP_set=${CPP+set}
7360-ac_env_CPP_value=$CPP
7361-ac_cv_env_CPP_set=${CPP+set}
7362-ac_cv_env_CPP_value=$CPP
7363+ pwd)`
7364+# When building in place, set srcdir=.
7365+if test "$ac_abs_confdir" = "$ac_pwd"; then
7366+ srcdir=.
7367+fi
7368+# Remove unnecessary trailing slashes from srcdir.
7369+# Double slashes in file names in object file debugging info
7370+# mess up M-x gdb in Emacs.
7371+case $srcdir in
7372+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
7373+esac
7374+for ac_var in $ac_precious_vars; do
7375+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
7376+ eval ac_env_${ac_var}_value=\$${ac_var}
7377+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
7378+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
7379+done
7380
7381 #
7382 # Report the --help message.
7383@@ -798,9 +1230,6 @@ Configuration:
7384 -n, --no-create do not create output files
7385 --srcdir=DIR find the sources in DIR [configure dir or \`..']
7386
7387-_ACEOF
7388-
7389- cat <<_ACEOF
7390 Installation directories:
7391 --prefix=PREFIX install architecture-independent files in PREFIX
7392 [$ac_default_prefix]
7393@@ -818,15 +1247,22 @@ Fine tuning of the installation directories:
7394 --bindir=DIR user executables [EPREFIX/bin]
7395 --sbindir=DIR system admin executables [EPREFIX/sbin]
7396 --libexecdir=DIR program executables [EPREFIX/libexec]
7397- --datadir=DIR read-only architecture-independent data [PREFIX/share]
7398 --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
7399 --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
7400 --localstatedir=DIR modifiable single-machine data [PREFIX/var]
7401 --libdir=DIR object code libraries [EPREFIX/lib]
7402 --includedir=DIR C header files [PREFIX/include]
7403 --oldincludedir=DIR C header files for non-gcc [/usr/include]
7404- --infodir=DIR info documentation [PREFIX/info]
7405- --mandir=DIR man documentation [PREFIX/man]
7406+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
7407+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
7408+ --infodir=DIR info documentation [DATAROOTDIR/info]
7409+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
7410+ --mandir=DIR man documentation [DATAROOTDIR/man]
7411+ --docdir=DIR documentation root [DATAROOTDIR/doc/dash]
7412+ --htmldir=DIR html documentation [DOCDIR]
7413+ --dvidir=DIR dvi documentation [DOCDIR]
7414+ --pdfdir=DIR pdf documentation [DOCDIR]
7415+ --psdir=DIR ps documentation [DOCDIR]
7416 _ACEOF
7417
7418 cat <<\_ACEOF
7419@@ -849,6 +1285,9 @@ Optional Features:
7420 --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
7421 --disable-dependency-tracking speeds up one-time build
7422 --enable-dependency-tracking do not reject slow dependency extractors
7423+ --enable-static Build statical linked program
7424+ --enable-fnmatch Use fnmatch(3) from libc
7425+ --enable-glob Use glob(3) from libc
7426
7427 Optional Packages:
7428 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
7429@@ -860,128 +1299,100 @@ Some influential environment variables:
7430 CFLAGS C compiler flags
7431 LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
7432 nonstandard directory <lib dir>
7433- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
7434- headers in a nonstandard directory <include dir>
7435+ LIBS libraries to pass to the linker, e.g. -l<library>
7436+ CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
7437+ you have headers in a nonstandard directory <include dir>
7438+ YACC The `Yet Another C Compiler' implementation to use. Defaults to
7439+ the first program found out of: `bison -y', `byacc', `yacc'.
7440+ YFLAGS The list of arguments that will be passed by default to $YACC.
7441+ This script will default YFLAGS to the empty string to avoid a
7442+ default value of `-d' given by some make applications.
7443 CPP C preprocessor
7444
7445 Use these variables to override the choices made by `configure' or to help
7446 it to find libraries and programs with nonstandard names/locations.
7447
7448 _ACEOF
7449+ac_status=$?
7450 fi
7451
7452 if test "$ac_init_help" = "recursive"; then
7453 # If there are subdirs, report their specific --help.
7454- ac_popdir=`pwd`
7455 for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
7456- test -d $ac_dir || continue
7457+ test -d "$ac_dir" || continue
7458 ac_builddir=.
7459
7460-if test "$ac_dir" != .; then
7461+case "$ac_dir" in
7462+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
7463+*)
7464 ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
7465- # A "../" for each directory in $ac_dir_suffix.
7466- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
7467-else
7468- ac_dir_suffix= ac_top_builddir=
7469-fi
7470+ # A ".." for each directory in $ac_dir_suffix.
7471+ ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
7472+ case $ac_top_builddir_sub in
7473+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
7474+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
7475+ esac ;;
7476+esac
7477+ac_abs_top_builddir=$ac_pwd
7478+ac_abs_builddir=$ac_pwd$ac_dir_suffix
7479+# for backward compatibility:
7480+ac_top_builddir=$ac_top_build_prefix
7481
7482 case $srcdir in
7483- .) # No --srcdir option. We are building in place.
7484+ .) # We are building in place.
7485 ac_srcdir=.
7486- if test -z "$ac_top_builddir"; then
7487- ac_top_srcdir=.
7488- else
7489- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
7490- fi ;;
7491- [\\/]* | ?:[\\/]* ) # Absolute path.
7492+ ac_top_srcdir=$ac_top_builddir_sub
7493+ ac_abs_top_srcdir=$ac_pwd ;;
7494+ [\\/]* | ?:[\\/]* ) # Absolute name.
7495 ac_srcdir=$srcdir$ac_dir_suffix;
7496- ac_top_srcdir=$srcdir ;;
7497- *) # Relative path.
7498- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
7499- ac_top_srcdir=$ac_top_builddir$srcdir ;;
7500-esac
7501-
7502-# Do not use `cd foo && pwd` to compute absolute paths, because
7503-# the directories may not exist.
7504-case `pwd` in
7505-.) ac_abs_builddir="$ac_dir";;
7506-*)
7507- case "$ac_dir" in
7508- .) ac_abs_builddir=`pwd`;;
7509- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
7510- *) ac_abs_builddir=`pwd`/"$ac_dir";;
7511- esac;;
7512-esac
7513-case $ac_abs_builddir in
7514-.) ac_abs_top_builddir=${ac_top_builddir}.;;
7515-*)
7516- case ${ac_top_builddir}. in
7517- .) ac_abs_top_builddir=$ac_abs_builddir;;
7518- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
7519- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
7520- esac;;
7521-esac
7522-case $ac_abs_builddir in
7523-.) ac_abs_srcdir=$ac_srcdir;;
7524-*)
7525- case $ac_srcdir in
7526- .) ac_abs_srcdir=$ac_abs_builddir;;
7527- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
7528- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
7529- esac;;
7530+ ac_top_srcdir=$srcdir
7531+ ac_abs_top_srcdir=$srcdir ;;
7532+ *) # Relative name.
7533+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
7534+ ac_top_srcdir=$ac_top_build_prefix$srcdir
7535+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
7536 esac
7537-case $ac_abs_builddir in
7538-.) ac_abs_top_srcdir=$ac_top_srcdir;;
7539-*)
7540- case $ac_top_srcdir in
7541- .) ac_abs_top_srcdir=$ac_abs_builddir;;
7542- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
7543- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
7544- esac;;
7545-esac
7546-
7547- cd $ac_dir
7548- # Check for guested configure; otherwise get Cygnus style configure.
7549- if test -f $ac_srcdir/configure.gnu; then
7550- echo
7551- $SHELL $ac_srcdir/configure.gnu --help=recursive
7552- elif test -f $ac_srcdir/configure; then
7553- echo
7554- $SHELL $ac_srcdir/configure --help=recursive
7555- elif test -f $ac_srcdir/configure.ac ||
7556- test -f $ac_srcdir/configure.in; then
7557- echo
7558- $ac_configure --help
7559+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
7560+
7561+ cd "$ac_dir" || { ac_status=$?; continue; }
7562+ # Check for guested configure.
7563+ if test -f "$ac_srcdir/configure.gnu"; then
7564+ echo &&
7565+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
7566+ elif test -f "$ac_srcdir/configure"; then
7567+ echo &&
7568+ $SHELL "$ac_srcdir/configure" --help=recursive
7569 else
7570 echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
7571- fi
7572- cd "$ac_popdir"
7573+ fi || ac_status=$?
7574+ cd "$ac_pwd" || { ac_status=$?; break; }
7575 done
7576 fi
7577
7578-test -n "$ac_init_help" && exit 0
7579+test -n "$ac_init_help" && exit $ac_status
7580 if $ac_init_version; then
7581 cat <<\_ACEOF
7582 dash configure 0.5.4
7583-generated by GNU Autoconf 2.59
7584+generated by GNU Autoconf 2.61
7585
7586-Copyright (C) 2003 Free Software Foundation, Inc.
7587+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
7588+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
7589 This configure script is free software; the Free Software Foundation
7590 gives unlimited permission to copy, distribute and modify it.
7591 _ACEOF
7592- exit 0
7593+ exit
7594 fi
7595-exec 5>config.log
7596-cat >&5 <<_ACEOF
7597+cat >config.log <<_ACEOF
7598 This file contains any messages produced by compilers while
7599 running configure, to aid debugging if configure makes a mistake.
7600
7601 It was created by dash $as_me 0.5.4, which was
7602-generated by GNU Autoconf 2.59. Invocation command line was
7603+generated by GNU Autoconf 2.61. Invocation command line was
7604
7605 $ $0 $@
7606
7607 _ACEOF
7608+exec 5>>config.log
7609 {
7610 cat <<_ASUNAME
7611 ## --------- ##
7612@@ -1000,7 +1411,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown`
7613 /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
7614 /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
7615 /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
7616-hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
7617+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
7618 /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
7619 /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
7620 /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
7621@@ -1014,6 +1425,7 @@ do
7622 test -z "$as_dir" && as_dir=.
7623 echo "PATH: $as_dir"
7624 done
7625+IFS=$as_save_IFS
7626
7627 } >&5
7628
7629@@ -1035,7 +1447,6 @@ _ACEOF
7630 ac_configure_args=
7631 ac_configure_args0=
7632 ac_configure_args1=
7633-ac_sep=
7634 ac_must_keep_next=false
7635 for ac_pass in 1 2
7636 do
7637@@ -1046,7 +1457,7 @@ do
7638 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
7639 | -silent | --silent | --silen | --sile | --sil)
7640 continue ;;
7641- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
7642+ *\'*)
7643 ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
7644 esac
7645 case $ac_pass in
7646@@ -1068,9 +1479,7 @@ do
7647 -* ) ac_must_keep_next=true ;;
7648 esac
7649 fi
7650- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
7651- # Get rid of the leading space.
7652- ac_sep=" "
7653+ ac_configure_args="$ac_configure_args '$ac_arg'"
7654 ;;
7655 esac
7656 done
7657@@ -1081,8 +1490,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_
7658 # When interrupted or exit'd, cleanup temporary files, and complete
7659 # config.log. We remove comments because anyway the quotes in there
7660 # would cause problems or look ugly.
7661-# WARNING: Be sure not to use single quotes in there, as some shells,
7662-# such as our DU 5.0 friend, will then `close' the trap.
7663+# WARNING: Use '\'' to represent an apostrophe within the trap.
7664+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
7665 trap 'exit_status=$?
7666 # Save into config.log some information that might help in debugging.
7667 {
7668@@ -1095,20 +1504,34 @@ trap 'exit_status=$?
7669 _ASBOX
7670 echo
7671 # The following way of writing the cache mishandles newlines in values,
7672-{
7673+(
7674+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
7675+ eval ac_val=\$$ac_var
7676+ case $ac_val in #(
7677+ *${as_nl}*)
7678+ case $ac_var in #(
7679+ *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
7680+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
7681+ esac
7682+ case $ac_var in #(
7683+ _ | IFS | as_nl) ;; #(
7684+ *) $as_unset $ac_var ;;
7685+ esac ;;
7686+ esac
7687+ done
7688 (set) 2>&1 |
7689- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
7690- *ac_space=\ *)
7691+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
7692+ *${as_nl}ac_space=\ *)
7693 sed -n \
7694- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
7695- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
7696- ;;
7697+ "s/'\''/'\''\\\\'\'''\''/g;
7698+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
7699+ ;; #(
7700 *)
7701- sed -n \
7702- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
7703+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
7704 ;;
7705- esac;
7706-}
7707+ esac |
7708+ sort
7709+)
7710 echo
7711
7712 cat <<\_ASBOX
7713@@ -1119,22 +1542,28 @@ _ASBOX
7714 echo
7715 for ac_var in $ac_subst_vars
7716 do
7717- eval ac_val=$`echo $ac_var`
7718- echo "$ac_var='"'"'$ac_val'"'"'"
7719+ eval ac_val=\$$ac_var
7720+ case $ac_val in
7721+ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
7722+ esac
7723+ echo "$ac_var='\''$ac_val'\''"
7724 done | sort
7725 echo
7726
7727 if test -n "$ac_subst_files"; then
7728 cat <<\_ASBOX
7729-## ------------- ##
7730-## Output files. ##
7731-## ------------- ##
7732+## ------------------- ##
7733+## File substitutions. ##
7734+## ------------------- ##
7735 _ASBOX
7736 echo
7737 for ac_var in $ac_subst_files
7738 do
7739- eval ac_val=$`echo $ac_var`
7740- echo "$ac_var='"'"'$ac_val'"'"'"
7741+ eval ac_val=\$$ac_var
7742+ case $ac_val in
7743+ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
7744+ esac
7745+ echo "$ac_var='\''$ac_val'\''"
7746 done | sort
7747 echo
7748 fi
7749@@ -1146,26 +1575,24 @@ _ASBOX
7750 ## ----------- ##
7751 _ASBOX
7752 echo
7753- sed "/^$/d" confdefs.h | sort
7754+ cat confdefs.h
7755 echo
7756 fi
7757 test "$ac_signal" != 0 &&
7758 echo "$as_me: caught signal $ac_signal"
7759 echo "$as_me: exit $exit_status"
7760 } >&5
7761- rm -f core *.core &&
7762- rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
7763+ rm -f core *.core core.conftest.* &&
7764+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
7765 exit $exit_status
7766- ' 0
7767+' 0
7768 for ac_signal in 1 2 13 15; do
7769 trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
7770 done
7771 ac_signal=0
7772
7773 # confdefs.h avoids OS command line length limits that DEFS can exceed.
7774-rm -rf conftest* confdefs.h
7775-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
7776-echo >confdefs.h
7777+rm -f -r conftest* confdefs.h
7778
7779 # Predefined preprocessor variables.
7780
7781@@ -1196,14 +1623,17 @@ _ACEOF
7782
7783 # Let the site file select an alternate cache file if it wants to.
7784 # Prefer explicitly selected file to automatically selected ones.
7785-if test -z "$CONFIG_SITE"; then
7786- if test "x$prefix" != xNONE; then
7787- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
7788- else
7789- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
7790- fi
7791+if test -n "$CONFIG_SITE"; then
7792+ set x "$CONFIG_SITE"
7793+elif test "x$prefix" != xNONE; then
7794+ set x "$prefix/share/config.site" "$prefix/etc/config.site"
7795+else
7796+ set x "$ac_default_prefix/share/config.site" \
7797+ "$ac_default_prefix/etc/config.site"
7798 fi
7799-for ac_site_file in $CONFIG_SITE; do
7800+shift
7801+for ac_site_file
7802+do
7803 if test -r "$ac_site_file"; then
7804 { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
7805 echo "$as_me: loading site script $ac_site_file" >&6;}
7806@@ -1219,8 +1649,8 @@ if test -r "$cache_file"; then
7807 { echo "$as_me:$LINENO: loading cache $cache_file" >&5
7808 echo "$as_me: loading cache $cache_file" >&6;}
7809 case $cache_file in
7810- [\\/]* | ?:[\\/]* ) . $cache_file;;
7811- *) . ./$cache_file;;
7812+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
7813+ *) . "./$cache_file";;
7814 esac
7815 fi
7816 else
7817@@ -1232,12 +1662,11 @@ fi
7818 # Check that the precious variables saved in the cache have kept the same
7819 # value.
7820 ac_cache_corrupted=false
7821-for ac_var in `(set) 2>&1 |
7822- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
7823+for ac_var in $ac_precious_vars; do
7824 eval ac_old_set=\$ac_cv_env_${ac_var}_set
7825 eval ac_new_set=\$ac_env_${ac_var}_set
7826- eval ac_old_val="\$ac_cv_env_${ac_var}_value"
7827- eval ac_new_val="\$ac_env_${ac_var}_value"
7828+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
7829+ eval ac_new_val=\$ac_env_${ac_var}_value
7830 case $ac_old_set,$ac_new_set in
7831 set,)
7832 { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
7833@@ -1262,8 +1691,7 @@ echo "$as_me: current value: $ac_new_val" >&2;}
7834 # Pass precious variables to config.status.
7835 if test "$ac_new_set" = set; then
7836 case $ac_new_val in
7837- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
7838- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
7839+ *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
7840 *) ac_arg=$ac_var=$ac_new_val ;;
7841 esac
7842 case " $ac_configure_args " in
7843@@ -1280,11 +1708,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov
7844 { (exit 1); exit 1; }; }
7845 fi
7846
7847-ac_ext=c
7848-ac_cpp='$CPP $CPPFLAGS'
7849-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7850-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7851-ac_compiler_gnu=$ac_cv_c_compiler_gnu
7852
7853
7854
7855@@ -1309,34 +1732,45 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
7856
7857
7858
7859+ac_ext=c
7860+ac_cpp='$CPP $CPPFLAGS'
7861+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
7862+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
7863+ac_compiler_gnu=$ac_cv_c_compiler_gnu
7864
7865
7866+am__api_version='1.10'
7867
7868-am__api_version="1.9"
7869 ac_aux_dir=
7870-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
7871- if test -f $ac_dir/install-sh; then
7872+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
7873+ if test -f "$ac_dir/install-sh"; then
7874 ac_aux_dir=$ac_dir
7875 ac_install_sh="$ac_aux_dir/install-sh -c"
7876 break
7877- elif test -f $ac_dir/install.sh; then
7878+ elif test -f "$ac_dir/install.sh"; then
7879 ac_aux_dir=$ac_dir
7880 ac_install_sh="$ac_aux_dir/install.sh -c"
7881 break
7882- elif test -f $ac_dir/shtool; then
7883+ elif test -f "$ac_dir/shtool"; then
7884 ac_aux_dir=$ac_dir
7885 ac_install_sh="$ac_aux_dir/shtool install -c"
7886 break
7887 fi
7888 done
7889 if test -z "$ac_aux_dir"; then
7890- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
7891-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
7892+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
7893+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
7894 { (exit 1); exit 1; }; }
7895 fi
7896-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
7897-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
7898-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
7899+
7900+# These three variables are undocumented and unsupported,
7901+# and are intended to be withdrawn in a future Autoconf release.
7902+# They can cause serious problems if a builder's source tree is in a directory
7903+# whose full name contains unusual characters.
7904+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
7905+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
7906+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
7907+
7908
7909 # Find a good install program. We prefer a C program (faster),
7910 # so one script is as good as another. But avoid the broken or
7911@@ -1351,8 +1785,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
7912 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
7913 # OS/2's system install, which has a completely different semantic
7914 # ./install, which can be erroneously created by make from ./install.sh.
7915-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
7916-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
7917+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
7918+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
7919 if test -z "$INSTALL"; then
7920 if test "${ac_cv_path_install+set}" = set; then
7921 echo $ECHO_N "(cached) $ECHO_C" >&6
7922@@ -1374,7 +1808,7 @@ case $as_dir/ in
7923 # by default.
7924 for ac_prog in ginstall scoinst install; do
7925 for ac_exec_ext in '' $ac_executable_extensions; do
7926- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
7927+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
7928 if test $ac_prog = install &&
7929 grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
7930 # AIX install. It has an incompatible calling convention.
7931@@ -1393,21 +1827,22 @@ case $as_dir/ in
7932 ;;
7933 esac
7934 done
7935+IFS=$as_save_IFS
7936
7937
7938 fi
7939 if test "${ac_cv_path_install+set}" = set; then
7940 INSTALL=$ac_cv_path_install
7941 else
7942- # As a last resort, use the slow shell script. We don't cache a
7943- # path for INSTALL within a source directory, because that will
7944+ # As a last resort, use the slow shell script. Don't cache a
7945+ # value for INSTALL within a source directory, because that will
7946 # break other packages using the cache if that directory is
7947- # removed, or if the path is relative.
7948+ # removed, or if the value is a relative name.
7949 INSTALL=$ac_install_sh
7950 fi
7951 fi
7952-echo "$as_me:$LINENO: result: $INSTALL" >&5
7953-echo "${ECHO_T}$INSTALL" >&6
7954+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
7955+echo "${ECHO_T}$INSTALL" >&6; }
7956
7957 # Use test -z because SunOS4 sh mishandles braces in ${var-val}.
7958 # It thinks the first close brace ends the variable substitution.
7959@@ -1417,8 +1852,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
7960
7961 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
7962
7963-echo "$as_me:$LINENO: checking whether build environment is sane" >&5
7964-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
7965+{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
7966+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
7967 # Just in case
7968 sleep 1
7969 echo timestamp > conftest.file
7970@@ -1460,20 +1895,20 @@ echo "$as_me: error: newly created file is older than distributed files!
7971 Check your system clock" >&2;}
7972 { (exit 1); exit 1; }; }
7973 fi
7974-echo "$as_me:$LINENO: result: yes" >&5
7975-echo "${ECHO_T}yes" >&6
7976+{ echo "$as_me:$LINENO: result: yes" >&5
7977+echo "${ECHO_T}yes" >&6; }
7978 test "$program_prefix" != NONE &&
7979- program_transform_name="s,^,$program_prefix,;$program_transform_name"
7980+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
7981 # Use a double $ so make ignores it.
7982 test "$program_suffix" != NONE &&
7983- program_transform_name="s,\$,$program_suffix,;$program_transform_name"
7984+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
7985 # Double any \ or $. echo might interpret backslashes.
7986 # By default was `s,x,x', remove it if useless.
7987 cat <<\_ACEOF >conftest.sed
7988 s/[\\$]/&&/g;s/;s,x,x,$//
7989 _ACEOF
7990 program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
7991-rm conftest.sed
7992+rm -f conftest.sed
7993
7994 # expand $ac_aux_dir to an absolute path
7995 am_aux_dir=`cd $ac_aux_dir && pwd`
7996@@ -1488,45 +1923,60 @@ else
7997 echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
7998 fi
7999
8000-if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
8001- # We used to keeping the `.' as first argument, in order to
8002- # allow $(mkdir_p) to be used without argument. As in
8003- # $(mkdir_p) $(somedir)
8004- # where $(somedir) is conditionally defined. However this is wrong
8005- # for two reasons:
8006- # 1. if the package is installed by a user who cannot write `.'
8007- # make install will fail,
8008- # 2. the above comment should most certainly read
8009- # $(mkdir_p) $(DESTDIR)$(somedir)
8010- # so it does not work when $(somedir) is undefined and
8011- # $(DESTDIR) is not.
8012- # To support the latter case, we have to write
8013- # test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
8014- # so the `.' trick is pointless.
8015- mkdir_p='mkdir -p --'
8016-else
8017- # On NextStep and OpenStep, the `mkdir' command does not
8018- # recognize any option. It will interpret all options as
8019- # directories to create, and then abort because `.' already
8020- # exists.
8021- for d in ./-p ./--version;
8022- do
8023- test -d $d && rmdir $d
8024- done
8025- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
8026- if test -f "$ac_aux_dir/mkinstalldirs"; then
8027- mkdir_p='$(mkinstalldirs)'
8028+{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
8029+echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
8030+if test -z "$MKDIR_P"; then
8031+ if test "${ac_cv_path_mkdir+set}" = set; then
8032+ echo $ECHO_N "(cached) $ECHO_C" >&6
8033+else
8034+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8035+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
8036+do
8037+ IFS=$as_save_IFS
8038+ test -z "$as_dir" && as_dir=.
8039+ for ac_prog in mkdir gmkdir; do
8040+ for ac_exec_ext in '' $ac_executable_extensions; do
8041+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
8042+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
8043+ 'mkdir (GNU coreutils) '* | \
8044+ 'mkdir (coreutils) '* | \
8045+ 'mkdir (fileutils) '4.1*)
8046+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
8047+ break 3;;
8048+ esac
8049+ done
8050+ done
8051+done
8052+IFS=$as_save_IFS
8053+
8054+fi
8055+
8056+ if test "${ac_cv_path_mkdir+set}" = set; then
8057+ MKDIR_P="$ac_cv_path_mkdir -p"
8058 else
8059- mkdir_p='$(install_sh) -d'
8060+ # As a last resort, use the slow shell script. Don't cache a
8061+ # value for MKDIR_P within a source directory, because that will
8062+ # break other packages using the cache if that directory is
8063+ # removed, or if the value is a relative name.
8064+ test -d ./--version && rmdir ./--version
8065+ MKDIR_P="$ac_install_sh -d"
8066 fi
8067 fi
8068+{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
8069+echo "${ECHO_T}$MKDIR_P" >&6; }
8070+
8071+mkdir_p="$MKDIR_P"
8072+case $mkdir_p in
8073+ [\\/$]* | ?:[\\/]*) ;;
8074+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
8075+esac
8076
8077 for ac_prog in gawk mawk nawk awk
8078 do
8079 # Extract the first word of "$ac_prog", so it can be a program name with args.
8080 set dummy $ac_prog; ac_word=$2
8081-echo "$as_me:$LINENO: checking for $ac_word" >&5
8082-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8083+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
8084+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
8085 if test "${ac_cv_prog_AWK+set}" = set; then
8086 echo $ECHO_N "(cached) $ECHO_C" >&6
8087 else
8088@@ -1539,54 +1989,57 @@ do
8089 IFS=$as_save_IFS
8090 test -z "$as_dir" && as_dir=.
8091 for ac_exec_ext in '' $ac_executable_extensions; do
8092- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8093+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8094 ac_cv_prog_AWK="$ac_prog"
8095 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
8096 break 2
8097 fi
8098 done
8099 done
8100+IFS=$as_save_IFS
8101
8102 fi
8103 fi
8104 AWK=$ac_cv_prog_AWK
8105 if test -n "$AWK"; then
8106- echo "$as_me:$LINENO: result: $AWK" >&5
8107-echo "${ECHO_T}$AWK" >&6
8108+ { echo "$as_me:$LINENO: result: $AWK" >&5
8109+echo "${ECHO_T}$AWK" >&6; }
8110 else
8111- echo "$as_me:$LINENO: result: no" >&5
8112-echo "${ECHO_T}no" >&6
8113+ { echo "$as_me:$LINENO: result: no" >&5
8114+echo "${ECHO_T}no" >&6; }
8115 fi
8116
8117+
8118 test -n "$AWK" && break
8119 done
8120
8121-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
8122-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
8123-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
8124-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
8125+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
8126+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
8127+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
8128+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
8129 echo $ECHO_N "(cached) $ECHO_C" >&6
8130 else
8131 cat >conftest.make <<\_ACEOF
8132+SHELL = /bin/sh
8133 all:
8134- @echo 'ac_maketemp="$(MAKE)"'
8135+ @echo '@@@%%%=$(MAKE)=@@@%%%'
8136 _ACEOF
8137 # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
8138-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
8139-if test -n "$ac_maketemp"; then
8140- eval ac_cv_prog_make_${ac_make}_set=yes
8141-else
8142- eval ac_cv_prog_make_${ac_make}_set=no
8143-fi
8144+case `${MAKE-make} -f conftest.make 2>/dev/null` in
8145+ *@@@%%%=?*=@@@%%%*)
8146+ eval ac_cv_prog_make_${ac_make}_set=yes;;
8147+ *)
8148+ eval ac_cv_prog_make_${ac_make}_set=no;;
8149+esac
8150 rm -f conftest.make
8151 fi
8152-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
8153- echo "$as_me:$LINENO: result: yes" >&5
8154-echo "${ECHO_T}yes" >&6
8155+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
8156+ { echo "$as_me:$LINENO: result: yes" >&5
8157+echo "${ECHO_T}yes" >&6; }
8158 SET_MAKE=
8159 else
8160- echo "$as_me:$LINENO: result: no" >&5
8161-echo "${ECHO_T}no" >&6
8162+ { echo "$as_me:$LINENO: result: no" >&5
8163+echo "${ECHO_T}no" >&6; }
8164 SET_MAKE="MAKE=${MAKE-make}"
8165 fi
8166
8167@@ -1599,12 +2052,16 @@ else
8168 fi
8169 rmdir .tst 2>/dev/null
8170
8171-# test to see if srcdir already configured
8172-if test "`cd $srcdir && pwd`" != "`pwd`" &&
8173- test -f $srcdir/config.status; then
8174- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
8175+if test "`cd $srcdir && pwd`" != "`pwd`"; then
8176+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
8177+ # is not polluted with repeated "-I."
8178+ am__isrc=' -I$(srcdir)'
8179+ # test to see if srcdir already configured
8180+ if test -f $srcdir/config.status; then
8181+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
8182 echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
8183 { (exit 1); exit 1; }; }
8184+ fi
8185 fi
8186
8187 # test whether we have cygpath
8188@@ -1647,7 +2104,7 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
8189
8190 MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
8191
8192-install_sh=${install_sh-"$am_aux_dir/install-sh"}
8193+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
8194
8195 # Installed binaries are usually stripped using `strip' when the user
8196 # run `make install-strip'. However `strip' might not be the right
8197@@ -1657,8 +2114,8 @@ if test "$cross_compiling" != no; then
8198 if test -n "$ac_tool_prefix"; then
8199 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
8200 set dummy ${ac_tool_prefix}strip; ac_word=$2
8201-echo "$as_me:$LINENO: checking for $ac_word" >&5
8202-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8203+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
8204+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
8205 if test "${ac_cv_prog_STRIP+set}" = set; then
8206 echo $ECHO_N "(cached) $ECHO_C" >&6
8207 else
8208@@ -1671,32 +2128,34 @@ do
8209 IFS=$as_save_IFS
8210 test -z "$as_dir" && as_dir=.
8211 for ac_exec_ext in '' $ac_executable_extensions; do
8212- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8213+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8214 ac_cv_prog_STRIP="${ac_tool_prefix}strip"
8215 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
8216 break 2
8217 fi
8218 done
8219 done
8220+IFS=$as_save_IFS
8221
8222 fi
8223 fi
8224 STRIP=$ac_cv_prog_STRIP
8225 if test -n "$STRIP"; then
8226- echo "$as_me:$LINENO: result: $STRIP" >&5
8227-echo "${ECHO_T}$STRIP" >&6
8228+ { echo "$as_me:$LINENO: result: $STRIP" >&5
8229+echo "${ECHO_T}$STRIP" >&6; }
8230 else
8231- echo "$as_me:$LINENO: result: no" >&5
8232-echo "${ECHO_T}no" >&6
8233+ { echo "$as_me:$LINENO: result: no" >&5
8234+echo "${ECHO_T}no" >&6; }
8235 fi
8236
8237+
8238 fi
8239 if test -z "$ac_cv_prog_STRIP"; then
8240 ac_ct_STRIP=$STRIP
8241 # Extract the first word of "strip", so it can be a program name with args.
8242 set dummy strip; ac_word=$2
8243-echo "$as_me:$LINENO: checking for $ac_word" >&5
8244-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8245+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
8246+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
8247 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
8248 echo $ECHO_N "(cached) $ECHO_C" >&6
8249 else
8250@@ -1709,33 +2168,47 @@ do
8251 IFS=$as_save_IFS
8252 test -z "$as_dir" && as_dir=.
8253 for ac_exec_ext in '' $ac_executable_extensions; do
8254- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8255+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8256 ac_cv_prog_ac_ct_STRIP="strip"
8257 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
8258 break 2
8259 fi
8260 done
8261 done
8262+IFS=$as_save_IFS
8263
8264- test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
8265 fi
8266 fi
8267 ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
8268 if test -n "$ac_ct_STRIP"; then
8269- echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
8270-echo "${ECHO_T}$ac_ct_STRIP" >&6
8271+ { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
8272+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
8273 else
8274- echo "$as_me:$LINENO: result: no" >&5
8275-echo "${ECHO_T}no" >&6
8276+ { echo "$as_me:$LINENO: result: no" >&5
8277+echo "${ECHO_T}no" >&6; }
8278 fi
8279
8280- STRIP=$ac_ct_STRIP
8281+ if test "x$ac_ct_STRIP" = x; then
8282+ STRIP=":"
8283+ else
8284+ case $cross_compiling:$ac_tool_warned in
8285+yes:)
8286+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
8287+whose name does not start with the host triplet. If you think this
8288+configuration is useful to you, please write to autoconf@gnu.org." >&5
8289+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
8290+whose name does not start with the host triplet. If you think this
8291+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
8292+ac_tool_warned=yes ;;
8293+esac
8294+ STRIP=$ac_ct_STRIP
8295+ fi
8296 else
8297 STRIP="$ac_cv_prog_STRIP"
8298 fi
8299
8300 fi
8301-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
8302+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
8303
8304 # We need awk for the "check" target. The system "awk" is bad on
8305 # some platforms.
8306@@ -1751,7 +2224,7 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
8307
8308
8309
8310- ac_config_headers="$ac_config_headers config.h"
8311+ac_config_headers="$ac_config_headers config.h"
8312
8313
8314 ac_ext=c
8315@@ -1762,8 +2235,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
8316 if test -n "$ac_tool_prefix"; then
8317 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
8318 set dummy ${ac_tool_prefix}gcc; ac_word=$2
8319-echo "$as_me:$LINENO: checking for $ac_word" >&5
8320-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8321+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
8322+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
8323 if test "${ac_cv_prog_CC+set}" = set; then
8324 echo $ECHO_N "(cached) $ECHO_C" >&6
8325 else
8326@@ -1776,32 +2249,34 @@ do
8327 IFS=$as_save_IFS
8328 test -z "$as_dir" && as_dir=.
8329 for ac_exec_ext in '' $ac_executable_extensions; do
8330- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8331+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8332 ac_cv_prog_CC="${ac_tool_prefix}gcc"
8333 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
8334 break 2
8335 fi
8336 done
8337 done
8338+IFS=$as_save_IFS
8339
8340 fi
8341 fi
8342 CC=$ac_cv_prog_CC
8343 if test -n "$CC"; then
8344- echo "$as_me:$LINENO: result: $CC" >&5
8345-echo "${ECHO_T}$CC" >&6
8346+ { echo "$as_me:$LINENO: result: $CC" >&5
8347+echo "${ECHO_T}$CC" >&6; }
8348 else
8349- echo "$as_me:$LINENO: result: no" >&5
8350-echo "${ECHO_T}no" >&6
8351+ { echo "$as_me:$LINENO: result: no" >&5
8352+echo "${ECHO_T}no" >&6; }
8353 fi
8354
8355+
8356 fi
8357 if test -z "$ac_cv_prog_CC"; then
8358 ac_ct_CC=$CC
8359 # Extract the first word of "gcc", so it can be a program name with args.
8360 set dummy gcc; ac_word=$2
8361-echo "$as_me:$LINENO: checking for $ac_word" >&5
8362-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8363+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
8364+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
8365 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
8366 echo $ECHO_N "(cached) $ECHO_C" >&6
8367 else
8368@@ -1814,36 +2289,51 @@ do
8369 IFS=$as_save_IFS
8370 test -z "$as_dir" && as_dir=.
8371 for ac_exec_ext in '' $ac_executable_extensions; do
8372- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8373+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8374 ac_cv_prog_ac_ct_CC="gcc"
8375 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
8376 break 2
8377 fi
8378 done
8379 done
8380+IFS=$as_save_IFS
8381
8382 fi
8383 fi
8384 ac_ct_CC=$ac_cv_prog_ac_ct_CC
8385 if test -n "$ac_ct_CC"; then
8386- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
8387-echo "${ECHO_T}$ac_ct_CC" >&6
8388+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
8389+echo "${ECHO_T}$ac_ct_CC" >&6; }
8390 else
8391- echo "$as_me:$LINENO: result: no" >&5
8392-echo "${ECHO_T}no" >&6
8393+ { echo "$as_me:$LINENO: result: no" >&5
8394+echo "${ECHO_T}no" >&6; }
8395 fi
8396
8397- CC=$ac_ct_CC
8398+ if test "x$ac_ct_CC" = x; then
8399+ CC=""
8400+ else
8401+ case $cross_compiling:$ac_tool_warned in
8402+yes:)
8403+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
8404+whose name does not start with the host triplet. If you think this
8405+configuration is useful to you, please write to autoconf@gnu.org." >&5
8406+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
8407+whose name does not start with the host triplet. If you think this
8408+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
8409+ac_tool_warned=yes ;;
8410+esac
8411+ CC=$ac_ct_CC
8412+ fi
8413 else
8414 CC="$ac_cv_prog_CC"
8415 fi
8416
8417 if test -z "$CC"; then
8418- if test -n "$ac_tool_prefix"; then
8419- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
8420+ if test -n "$ac_tool_prefix"; then
8421+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
8422 set dummy ${ac_tool_prefix}cc; ac_word=$2
8423-echo "$as_me:$LINENO: checking for $ac_word" >&5
8424-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8425+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
8426+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
8427 if test "${ac_cv_prog_CC+set}" = set; then
8428 echo $ECHO_N "(cached) $ECHO_C" >&6
8429 else
8430@@ -1856,74 +2346,34 @@ do
8431 IFS=$as_save_IFS
8432 test -z "$as_dir" && as_dir=.
8433 for ac_exec_ext in '' $ac_executable_extensions; do
8434- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8435+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8436 ac_cv_prog_CC="${ac_tool_prefix}cc"
8437 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
8438 break 2
8439 fi
8440 done
8441 done
8442+IFS=$as_save_IFS
8443
8444 fi
8445 fi
8446 CC=$ac_cv_prog_CC
8447 if test -n "$CC"; then
8448- echo "$as_me:$LINENO: result: $CC" >&5
8449-echo "${ECHO_T}$CC" >&6
8450-else
8451- echo "$as_me:$LINENO: result: no" >&5
8452-echo "${ECHO_T}no" >&6
8453-fi
8454-
8455-fi
8456-if test -z "$ac_cv_prog_CC"; then
8457- ac_ct_CC=$CC
8458- # Extract the first word of "cc", so it can be a program name with args.
8459-set dummy cc; ac_word=$2
8460-echo "$as_me:$LINENO: checking for $ac_word" >&5
8461-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8462-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
8463- echo $ECHO_N "(cached) $ECHO_C" >&6
8464-else
8465- if test -n "$ac_ct_CC"; then
8466- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
8467-else
8468-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
8469-for as_dir in $PATH
8470-do
8471- IFS=$as_save_IFS
8472- test -z "$as_dir" && as_dir=.
8473- for ac_exec_ext in '' $ac_executable_extensions; do
8474- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8475- ac_cv_prog_ac_ct_CC="cc"
8476- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
8477- break 2
8478- fi
8479-done
8480-done
8481-
8482-fi
8483-fi
8484-ac_ct_CC=$ac_cv_prog_ac_ct_CC
8485-if test -n "$ac_ct_CC"; then
8486- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
8487-echo "${ECHO_T}$ac_ct_CC" >&6
8488+ { echo "$as_me:$LINENO: result: $CC" >&5
8489+echo "${ECHO_T}$CC" >&6; }
8490 else
8491- echo "$as_me:$LINENO: result: no" >&5
8492-echo "${ECHO_T}no" >&6
8493+ { echo "$as_me:$LINENO: result: no" >&5
8494+echo "${ECHO_T}no" >&6; }
8495 fi
8496
8497- CC=$ac_ct_CC
8498-else
8499- CC="$ac_cv_prog_CC"
8500-fi
8501
8502+ fi
8503 fi
8504 if test -z "$CC"; then
8505 # Extract the first word of "cc", so it can be a program name with args.
8506 set dummy cc; ac_word=$2
8507-echo "$as_me:$LINENO: checking for $ac_word" >&5
8508-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8509+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
8510+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
8511 if test "${ac_cv_prog_CC+set}" = set; then
8512 echo $ECHO_N "(cached) $ECHO_C" >&6
8513 else
8514@@ -1937,7 +2387,7 @@ do
8515 IFS=$as_save_IFS
8516 test -z "$as_dir" && as_dir=.
8517 for ac_exec_ext in '' $ac_executable_extensions; do
8518- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8519+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8520 if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
8521 ac_prog_rejected=yes
8522 continue
8523@@ -1948,6 +2398,7 @@ do
8524 fi
8525 done
8526 done
8527+IFS=$as_save_IFS
8528
8529 if test $ac_prog_rejected = yes; then
8530 # We found a bogon in the path, so make sure we never use it.
8531@@ -1965,22 +2416,23 @@ fi
8532 fi
8533 CC=$ac_cv_prog_CC
8534 if test -n "$CC"; then
8535- echo "$as_me:$LINENO: result: $CC" >&5
8536-echo "${ECHO_T}$CC" >&6
8537+ { echo "$as_me:$LINENO: result: $CC" >&5
8538+echo "${ECHO_T}$CC" >&6; }
8539 else
8540- echo "$as_me:$LINENO: result: no" >&5
8541-echo "${ECHO_T}no" >&6
8542+ { echo "$as_me:$LINENO: result: no" >&5
8543+echo "${ECHO_T}no" >&6; }
8544 fi
8545
8546+
8547 fi
8548 if test -z "$CC"; then
8549 if test -n "$ac_tool_prefix"; then
8550- for ac_prog in cl
8551+ for ac_prog in cl.exe
8552 do
8553 # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
8554 set dummy $ac_tool_prefix$ac_prog; ac_word=$2
8555-echo "$as_me:$LINENO: checking for $ac_word" >&5
8556-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8557+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
8558+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
8559 if test "${ac_cv_prog_CC+set}" = set; then
8560 echo $ECHO_N "(cached) $ECHO_C" >&6
8561 else
8562@@ -1993,36 +2445,38 @@ do
8563 IFS=$as_save_IFS
8564 test -z "$as_dir" && as_dir=.
8565 for ac_exec_ext in '' $ac_executable_extensions; do
8566- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8567+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8568 ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
8569 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
8570 break 2
8571 fi
8572 done
8573 done
8574+IFS=$as_save_IFS
8575
8576 fi
8577 fi
8578 CC=$ac_cv_prog_CC
8579 if test -n "$CC"; then
8580- echo "$as_me:$LINENO: result: $CC" >&5
8581-echo "${ECHO_T}$CC" >&6
8582+ { echo "$as_me:$LINENO: result: $CC" >&5
8583+echo "${ECHO_T}$CC" >&6; }
8584 else
8585- echo "$as_me:$LINENO: result: no" >&5
8586-echo "${ECHO_T}no" >&6
8587+ { echo "$as_me:$LINENO: result: no" >&5
8588+echo "${ECHO_T}no" >&6; }
8589 fi
8590
8591+
8592 test -n "$CC" && break
8593 done
8594 fi
8595 if test -z "$CC"; then
8596 ac_ct_CC=$CC
8597- for ac_prog in cl
8598+ for ac_prog in cl.exe
8599 do
8600 # Extract the first word of "$ac_prog", so it can be a program name with args.
8601 set dummy $ac_prog; ac_word=$2
8602-echo "$as_me:$LINENO: checking for $ac_word" >&5
8603-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
8604+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
8605+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
8606 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
8607 echo $ECHO_N "(cached) $ECHO_C" >&6
8608 else
8609@@ -2035,29 +2489,45 @@ do
8610 IFS=$as_save_IFS
8611 test -z "$as_dir" && as_dir=.
8612 for ac_exec_ext in '' $ac_executable_extensions; do
8613- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
8614+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
8615 ac_cv_prog_ac_ct_CC="$ac_prog"
8616 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
8617 break 2
8618 fi
8619 done
8620 done
8621+IFS=$as_save_IFS
8622
8623 fi
8624 fi
8625 ac_ct_CC=$ac_cv_prog_ac_ct_CC
8626 if test -n "$ac_ct_CC"; then
8627- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
8628-echo "${ECHO_T}$ac_ct_CC" >&6
8629+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
8630+echo "${ECHO_T}$ac_ct_CC" >&6; }
8631 else
8632- echo "$as_me:$LINENO: result: no" >&5
8633-echo "${ECHO_T}no" >&6
8634+ { echo "$as_me:$LINENO: result: no" >&5
8635+echo "${ECHO_T}no" >&6; }
8636 fi
8637
8638+
8639 test -n "$ac_ct_CC" && break
8640 done
8641
8642- CC=$ac_ct_CC
8643+ if test "x$ac_ct_CC" = x; then
8644+ CC=""
8645+ else
8646+ case $cross_compiling:$ac_tool_warned in
8647+yes:)
8648+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
8649+whose name does not start with the host triplet. If you think this
8650+configuration is useful to you, please write to autoconf@gnu.org." >&5
8651+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
8652+whose name does not start with the host triplet. If you think this
8653+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
8654+ac_tool_warned=yes ;;
8655+esac
8656+ CC=$ac_ct_CC
8657+ fi
8658 fi
8659
8660 fi
8661@@ -2070,21 +2540,35 @@ See \`config.log' for more details." >&2;}
8662 { (exit 1); exit 1; }; }
8663
8664 # Provide some information about the compiler.
8665-echo "$as_me:$LINENO:" \
8666- "checking for C compiler version" >&5
8667+echo "$as_me:$LINENO: checking for C compiler version" >&5
8668 ac_compiler=`set X $ac_compile; echo $2`
8669-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
8670- (eval $ac_compiler --version </dev/null >&5) 2>&5
8671+{ (ac_try="$ac_compiler --version >&5"
8672+case "(($ac_try" in
8673+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8674+ *) ac_try_echo=$ac_try;;
8675+esac
8676+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8677+ (eval "$ac_compiler --version >&5") 2>&5
8678 ac_status=$?
8679 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8680 (exit $ac_status); }
8681-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
8682- (eval $ac_compiler -v </dev/null >&5) 2>&5
8683+{ (ac_try="$ac_compiler -v >&5"
8684+case "(($ac_try" in
8685+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8686+ *) ac_try_echo=$ac_try;;
8687+esac
8688+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8689+ (eval "$ac_compiler -v >&5") 2>&5
8690 ac_status=$?
8691 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8692 (exit $ac_status); }
8693-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
8694- (eval $ac_compiler -V </dev/null >&5) 2>&5
8695+{ (ac_try="$ac_compiler -V >&5"
8696+case "(($ac_try" in
8697+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8698+ *) ac_try_echo=$ac_try;;
8699+esac
8700+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8701+ (eval "$ac_compiler -V >&5") 2>&5
8702 ac_status=$?
8703 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8704 (exit $ac_status); }
8705@@ -2109,47 +2593,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out"
8706 # Try to create an executable without -o first, disregard a.out.
8707 # It will help us diagnose broken compilers, and finding out an intuition
8708 # of exeext.
8709-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
8710-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
8711+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
8712+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
8713 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
8714-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
8715- (eval $ac_link_default) 2>&5
8716+#
8717+# List of possible output files, starting from the most likely.
8718+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
8719+# only as a last resort. b.out is created by i960 compilers.
8720+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
8721+#
8722+# The IRIX 6 linker writes into existing files which may not be
8723+# executable, retaining their permissions. Remove them first so a
8724+# subsequent execution test works.
8725+ac_rmfiles=
8726+for ac_file in $ac_files
8727+do
8728+ case $ac_file in
8729+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
8730+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
8731+ esac
8732+done
8733+rm -f $ac_rmfiles
8734+
8735+if { (ac_try="$ac_link_default"
8736+case "(($ac_try" in
8737+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8738+ *) ac_try_echo=$ac_try;;
8739+esac
8740+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8741+ (eval "$ac_link_default") 2>&5
8742 ac_status=$?
8743 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8744 (exit $ac_status); }; then
8745- # Find the output, starting from the most likely. This scheme is
8746-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
8747-# resort.
8748-
8749-# Be careful to initialize this variable, since it used to be cached.
8750-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
8751-ac_cv_exeext=
8752-# b.out is created by i960 compilers.
8753-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
8754+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
8755+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
8756+# in a Makefile. We should not override ac_cv_exeext if it was cached,
8757+# so that the user can short-circuit this test for compilers unknown to
8758+# Autoconf.
8759+for ac_file in $ac_files ''
8760 do
8761 test -f "$ac_file" || continue
8762 case $ac_file in
8763- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
8764- ;;
8765- conftest.$ac_ext )
8766- # This is the source file.
8767+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
8768 ;;
8769 [ab].out )
8770 # We found the default executable, but exeext='' is most
8771 # certainly right.
8772 break;;
8773 *.* )
8774- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
8775- # FIXME: I believe we export ac_cv_exeext for Libtool,
8776- # but it would be cool to find out if it's true. Does anybody
8777- # maintain Libtool? --akim.
8778- export ac_cv_exeext
8779+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
8780+ then :; else
8781+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
8782+ fi
8783+ # We set ac_cv_exeext here because the later test for it is not
8784+ # safe: cross compilers may not add the suffix if given an `-o'
8785+ # argument, so we may need to know it at that point already.
8786+ # Even if this section looks crufty: it has the advantage of
8787+ # actually working.
8788 break;;
8789 * )
8790 break;;
8791 esac
8792 done
8793+test "$ac_cv_exeext" = no && ac_cv_exeext=
8794+
8795 else
8796+ ac_file=''
8797+fi
8798+
8799+{ echo "$as_me:$LINENO: result: $ac_file" >&5
8800+echo "${ECHO_T}$ac_file" >&6; }
8801+if test -z "$ac_file"; then
8802 echo "$as_me: failed program was:" >&5
8803 sed 's/^/| /' conftest.$ac_ext >&5
8804
8805@@ -2161,19 +2675,21 @@ See \`config.log' for more details." >&2;}
8806 fi
8807
8808 ac_exeext=$ac_cv_exeext
8809-echo "$as_me:$LINENO: result: $ac_file" >&5
8810-echo "${ECHO_T}$ac_file" >&6
8811
8812-# Check the compiler produces executables we can run. If not, either
8813+# Check that the compiler produces executables we can run. If not, either
8814 # the compiler is broken, or we cross compile.
8815-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
8816-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
8817+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
8818+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
8819 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0
8820 # If not cross compiling, check that we can run a simple program.
8821 if test "$cross_compiling" != yes; then
8822 if { ac_try='./$ac_file'
8823- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8824- (eval $ac_try) 2>&5
8825+ { (case "(($ac_try" in
8826+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8827+ *) ac_try_echo=$ac_try;;
8828+esac
8829+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8830+ (eval "$ac_try") 2>&5
8831 ac_status=$?
8832 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8833 (exit $ac_status); }; }; then
8834@@ -2192,22 +2708,27 @@ See \`config.log' for more details." >&2;}
8835 fi
8836 fi
8837 fi
8838-echo "$as_me:$LINENO: result: yes" >&5
8839-echo "${ECHO_T}yes" >&6
8840+{ echo "$as_me:$LINENO: result: yes" >&5
8841+echo "${ECHO_T}yes" >&6; }
8842
8843 rm -f a.out a.exe conftest$ac_cv_exeext b.out
8844 ac_clean_files=$ac_clean_files_save
8845-# Check the compiler produces executables we can run. If not, either
8846+# Check that the compiler produces executables we can run. If not, either
8847 # the compiler is broken, or we cross compile.
8848-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
8849-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
8850-echo "$as_me:$LINENO: result: $cross_compiling" >&5
8851-echo "${ECHO_T}$cross_compiling" >&6
8852-
8853-echo "$as_me:$LINENO: checking for suffix of executables" >&5
8854-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
8855-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
8856- (eval $ac_link) 2>&5
8857+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
8858+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
8859+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
8860+echo "${ECHO_T}$cross_compiling" >&6; }
8861+
8862+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
8863+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
8864+if { (ac_try="$ac_link"
8865+case "(($ac_try" in
8866+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8867+ *) ac_try_echo=$ac_try;;
8868+esac
8869+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8870+ (eval "$ac_link") 2>&5
8871 ac_status=$?
8872 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8873 (exit $ac_status); }; then
8874@@ -2218,9 +2739,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
8875 for ac_file in conftest.exe conftest conftest.*; do
8876 test -f "$ac_file" || continue
8877 case $ac_file in
8878- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
8879+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
8880 *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
8881- export ac_cv_exeext
8882 break;;
8883 * ) break;;
8884 esac
8885@@ -2234,14 +2754,14 @@ See \`config.log' for more details." >&2;}
8886 fi
8887
8888 rm -f conftest$ac_cv_exeext
8889-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
8890-echo "${ECHO_T}$ac_cv_exeext" >&6
8891+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
8892+echo "${ECHO_T}$ac_cv_exeext" >&6; }
8893
8894 rm -f conftest.$ac_ext
8895 EXEEXT=$ac_cv_exeext
8896 ac_exeext=$EXEEXT
8897-echo "$as_me:$LINENO: checking for suffix of object files" >&5
8898-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
8899+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
8900+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
8901 if test "${ac_cv_objext+set}" = set; then
8902 echo $ECHO_N "(cached) $ECHO_C" >&6
8903 else
8904@@ -2261,14 +2781,20 @@ main ()
8905 }
8906 _ACEOF
8907 rm -f conftest.o conftest.obj
8908-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
8909- (eval $ac_compile) 2>&5
8910+if { (ac_try="$ac_compile"
8911+case "(($ac_try" in
8912+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8913+ *) ac_try_echo=$ac_try;;
8914+esac
8915+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8916+ (eval "$ac_compile") 2>&5
8917 ac_status=$?
8918 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8919 (exit $ac_status); }; then
8920- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
8921+ for ac_file in conftest.o conftest.obj conftest.*; do
8922+ test -f "$ac_file" || continue;
8923 case $ac_file in
8924- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
8925+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
8926 *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
8927 break;;
8928 esac
8929@@ -2286,12 +2812,12 @@ fi
8930
8931 rm -f conftest.$ac_cv_objext conftest.$ac_ext
8932 fi
8933-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
8934-echo "${ECHO_T}$ac_cv_objext" >&6
8935+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
8936+echo "${ECHO_T}$ac_cv_objext" >&6; }
8937 OBJEXT=$ac_cv_objext
8938 ac_objext=$OBJEXT
8939-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
8940-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
8941+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
8942+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
8943 if test "${ac_cv_c_compiler_gnu+set}" = set; then
8944 echo $ECHO_N "(cached) $ECHO_C" >&6
8945 else
8946@@ -2314,49 +2840,49 @@ main ()
8947 }
8948 _ACEOF
8949 rm -f conftest.$ac_objext
8950-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
8951- (eval $ac_compile) 2>conftest.er1
8952+if { (ac_try="$ac_compile"
8953+case "(($ac_try" in
8954+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
8955+ *) ac_try_echo=$ac_try;;
8956+esac
8957+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
8958+ (eval "$ac_compile") 2>conftest.er1
8959 ac_status=$?
8960 grep -v '^ *+' conftest.er1 >conftest.err
8961 rm -f conftest.er1
8962 cat conftest.err >&5
8963 echo "$as_me:$LINENO: \$? = $ac_status" >&5
8964- (exit $ac_status); } &&
8965- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
8966- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8967- (eval $ac_try) 2>&5
8968- ac_status=$?
8969- echo "$as_me:$LINENO: \$? = $ac_status" >&5
8970- (exit $ac_status); }; } &&
8971- { ac_try='test -s conftest.$ac_objext'
8972- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
8973- (eval $ac_try) 2>&5
8974- ac_status=$?
8975- echo "$as_me:$LINENO: \$? = $ac_status" >&5
8976- (exit $ac_status); }; }; then
8977+ (exit $ac_status); } && {
8978+ test -z "$ac_c_werror_flag" ||
8979+ test ! -s conftest.err
8980+ } && test -s conftest.$ac_objext; then
8981 ac_compiler_gnu=yes
8982 else
8983 echo "$as_me: failed program was:" >&5
8984 sed 's/^/| /' conftest.$ac_ext >&5
8985
8986-ac_compiler_gnu=no
8987+ ac_compiler_gnu=no
8988 fi
8989-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
8990+
8991+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8992 ac_cv_c_compiler_gnu=$ac_compiler_gnu
8993
8994 fi
8995-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
8996-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
8997+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
8998+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
8999 GCC=`test $ac_compiler_gnu = yes && echo yes`
9000 ac_test_CFLAGS=${CFLAGS+set}
9001 ac_save_CFLAGS=$CFLAGS
9002-CFLAGS="-g"
9003-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
9004-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
9005+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
9006+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
9007 if test "${ac_cv_prog_cc_g+set}" = set; then
9008 echo $ECHO_N "(cached) $ECHO_C" >&6
9009 else
9010- cat >conftest.$ac_ext <<_ACEOF
9011+ ac_save_c_werror_flag=$ac_c_werror_flag
9012+ ac_c_werror_flag=yes
9013+ ac_cv_prog_cc_g=no
9014+ CFLAGS="-g"
9015+ cat >conftest.$ac_ext <<_ACEOF
9016 /* confdefs.h. */
9017 _ACEOF
9018 cat confdefs.h >>conftest.$ac_ext
9019@@ -2372,37 +2898,118 @@ main ()
9020 }
9021 _ACEOF
9022 rm -f conftest.$ac_objext
9023-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
9024- (eval $ac_compile) 2>conftest.er1
9025+if { (ac_try="$ac_compile"
9026+case "(($ac_try" in
9027+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9028+ *) ac_try_echo=$ac_try;;
9029+esac
9030+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9031+ (eval "$ac_compile") 2>conftest.er1
9032 ac_status=$?
9033 grep -v '^ *+' conftest.er1 >conftest.err
9034 rm -f conftest.er1
9035 cat conftest.err >&5
9036 echo "$as_me:$LINENO: \$? = $ac_status" >&5
9037- (exit $ac_status); } &&
9038- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
9039- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9040- (eval $ac_try) 2>&5
9041+ (exit $ac_status); } && {
9042+ test -z "$ac_c_werror_flag" ||
9043+ test ! -s conftest.err
9044+ } && test -s conftest.$ac_objext; then
9045+ ac_cv_prog_cc_g=yes
9046+else
9047+ echo "$as_me: failed program was:" >&5
9048+sed 's/^/| /' conftest.$ac_ext >&5
9049+
9050+ CFLAGS=""
9051+ cat >conftest.$ac_ext <<_ACEOF
9052+/* confdefs.h. */
9053+_ACEOF
9054+cat confdefs.h >>conftest.$ac_ext
9055+cat >>conftest.$ac_ext <<_ACEOF
9056+/* end confdefs.h. */
9057+
9058+int
9059+main ()
9060+{
9061+
9062+ ;
9063+ return 0;
9064+}
9065+_ACEOF
9066+rm -f conftest.$ac_objext
9067+if { (ac_try="$ac_compile"
9068+case "(($ac_try" in
9069+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9070+ *) ac_try_echo=$ac_try;;
9071+esac
9072+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9073+ (eval "$ac_compile") 2>conftest.er1
9074 ac_status=$?
9075+ grep -v '^ *+' conftest.er1 >conftest.err
9076+ rm -f conftest.er1
9077+ cat conftest.err >&5
9078 echo "$as_me:$LINENO: \$? = $ac_status" >&5
9079- (exit $ac_status); }; } &&
9080- { ac_try='test -s conftest.$ac_objext'
9081- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9082- (eval $ac_try) 2>&5
9083+ (exit $ac_status); } && {
9084+ test -z "$ac_c_werror_flag" ||
9085+ test ! -s conftest.err
9086+ } && test -s conftest.$ac_objext; then
9087+ :
9088+else
9089+ echo "$as_me: failed program was:" >&5
9090+sed 's/^/| /' conftest.$ac_ext >&5
9091+
9092+ ac_c_werror_flag=$ac_save_c_werror_flag
9093+ CFLAGS="-g"
9094+ cat >conftest.$ac_ext <<_ACEOF
9095+/* confdefs.h. */
9096+_ACEOF
9097+cat confdefs.h >>conftest.$ac_ext
9098+cat >>conftest.$ac_ext <<_ACEOF
9099+/* end confdefs.h. */
9100+
9101+int
9102+main ()
9103+{
9104+
9105+ ;
9106+ return 0;
9107+}
9108+_ACEOF
9109+rm -f conftest.$ac_objext
9110+if { (ac_try="$ac_compile"
9111+case "(($ac_try" in
9112+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9113+ *) ac_try_echo=$ac_try;;
9114+esac
9115+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9116+ (eval "$ac_compile") 2>conftest.er1
9117 ac_status=$?
9118+ grep -v '^ *+' conftest.er1 >conftest.err
9119+ rm -f conftest.er1
9120+ cat conftest.err >&5
9121 echo "$as_me:$LINENO: \$? = $ac_status" >&5
9122- (exit $ac_status); }; }; then
9123+ (exit $ac_status); } && {
9124+ test -z "$ac_c_werror_flag" ||
9125+ test ! -s conftest.err
9126+ } && test -s conftest.$ac_objext; then
9127 ac_cv_prog_cc_g=yes
9128 else
9129 echo "$as_me: failed program was:" >&5
9130 sed 's/^/| /' conftest.$ac_ext >&5
9131
9132-ac_cv_prog_cc_g=no
9133+
9134 fi
9135-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
9136+
9137+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9138 fi
9139-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
9140-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
9141+
9142+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9143+fi
9144+
9145+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
9146+ ac_c_werror_flag=$ac_save_c_werror_flag
9147+fi
9148+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
9149+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
9150 if test "$ac_test_CFLAGS" = set; then
9151 CFLAGS=$ac_save_CFLAGS
9152 elif test $ac_cv_prog_cc_g = yes; then
9153@@ -2418,12 +3025,12 @@ else
9154 CFLAGS=
9155 fi
9156 fi
9157-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
9158-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
9159-if test "${ac_cv_prog_cc_stdc+set}" = set; then
9160+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
9161+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
9162+if test "${ac_cv_prog_cc_c89+set}" = set; then
9163 echo $ECHO_N "(cached) $ECHO_C" >&6
9164 else
9165- ac_cv_prog_cc_stdc=no
9166+ ac_cv_prog_cc_c89=no
9167 ac_save_CC=$CC
9168 cat >conftest.$ac_ext <<_ACEOF
9169 /* confdefs.h. */
9170@@ -2457,12 +3064,17 @@ static char *f (char * (*g) (char **, int), char **p, ...)
9171 /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
9172 function prototypes and stuff, but not '\xHH' hex character constants.
9173 These don't provoke an error unfortunately, instead are silently treated
9174- as 'x'. The following induces an error, until -std1 is added to get
9175+ as 'x'. The following induces an error, until -std is added to get
9176 proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
9177 array size at least. It's necessary to write '\x00'==0 to get something
9178- that's true only with -std1. */
9179+ that's true only with -std. */
9180 int osf4_cc_array ['\x00' == 0 ? 1 : -1];
9181
9182+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
9183+ inside strings and character constants. */
9184+#define FOO(x) 'x'
9185+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
9186+
9187 int test (int i, double x);
9188 struct s1 {int (*f) (int a);};
9189 struct s2 {int (*f) (double a);};
9190@@ -2477,201 +3089,57 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
9191 return 0;
9192 }
9193 _ACEOF
9194-# Don't try gcc -ansi; that turns off useful extensions and
9195-# breaks some systems' header files.
9196-# AIX -qlanglvl=ansi
9197-# Ultrix and OSF/1 -std1
9198-# HP-UX 10.20 and later -Ae
9199-# HP-UX older versions -Aa -D_HPUX_SOURCE
9200-# SVR4 -Xc -D__EXTENSIONS__
9201-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
9202+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
9203+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
9204 do
9205 CC="$ac_save_CC $ac_arg"
9206 rm -f conftest.$ac_objext
9207-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
9208- (eval $ac_compile) 2>conftest.er1
9209+if { (ac_try="$ac_compile"
9210+case "(($ac_try" in
9211+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9212+ *) ac_try_echo=$ac_try;;
9213+esac
9214+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9215+ (eval "$ac_compile") 2>conftest.er1
9216 ac_status=$?
9217 grep -v '^ *+' conftest.er1 >conftest.err
9218 rm -f conftest.er1
9219 cat conftest.err >&5
9220 echo "$as_me:$LINENO: \$? = $ac_status" >&5
9221- (exit $ac_status); } &&
9222- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
9223- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9224- (eval $ac_try) 2>&5
9225- ac_status=$?
9226- echo "$as_me:$LINENO: \$? = $ac_status" >&5
9227- (exit $ac_status); }; } &&
9228- { ac_try='test -s conftest.$ac_objext'
9229- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9230- (eval $ac_try) 2>&5
9231- ac_status=$?
9232- echo "$as_me:$LINENO: \$? = $ac_status" >&5
9233- (exit $ac_status); }; }; then
9234- ac_cv_prog_cc_stdc=$ac_arg
9235-break
9236+ (exit $ac_status); } && {
9237+ test -z "$ac_c_werror_flag" ||
9238+ test ! -s conftest.err
9239+ } && test -s conftest.$ac_objext; then
9240+ ac_cv_prog_cc_c89=$ac_arg
9241 else
9242 echo "$as_me: failed program was:" >&5
9243 sed 's/^/| /' conftest.$ac_ext >&5
9244
9245+
9246 fi
9247-rm -f conftest.err conftest.$ac_objext
9248+
9249+rm -f core conftest.err conftest.$ac_objext
9250+ test "x$ac_cv_prog_cc_c89" != "xno" && break
9251 done
9252-rm -f conftest.$ac_ext conftest.$ac_objext
9253+rm -f conftest.$ac_ext
9254 CC=$ac_save_CC
9255
9256 fi
9257-
9258-case "x$ac_cv_prog_cc_stdc" in
9259- x|xno)
9260- echo "$as_me:$LINENO: result: none needed" >&5
9261-echo "${ECHO_T}none needed" >&6 ;;
9262+# AC_CACHE_VAL
9263+case "x$ac_cv_prog_cc_c89" in
9264+ x)
9265+ { echo "$as_me:$LINENO: result: none needed" >&5
9266+echo "${ECHO_T}none needed" >&6; } ;;
9267+ xno)
9268+ { echo "$as_me:$LINENO: result: unsupported" >&5
9269+echo "${ECHO_T}unsupported" >&6; } ;;
9270 *)
9271- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
9272-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
9273- CC="$CC $ac_cv_prog_cc_stdc" ;;
9274+ CC="$CC $ac_cv_prog_cc_c89"
9275+ { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
9276+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
9277 esac
9278
9279-# Some people use a C++ compiler to compile C. Since we use `exit',
9280-# in C++ we need to declare it. In case someone uses the same compiler
9281-# for both compiling C and C++ we need to have the C++ compiler decide
9282-# the declaration of exit, since it's the most demanding environment.
9283-cat >conftest.$ac_ext <<_ACEOF
9284-#ifndef __cplusplus
9285- choke me
9286-#endif
9287-_ACEOF
9288-rm -f conftest.$ac_objext
9289-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
9290- (eval $ac_compile) 2>conftest.er1
9291- ac_status=$?
9292- grep -v '^ *+' conftest.er1 >conftest.err
9293- rm -f conftest.er1
9294- cat conftest.err >&5
9295- echo "$as_me:$LINENO: \$? = $ac_status" >&5
9296- (exit $ac_status); } &&
9297- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
9298- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9299- (eval $ac_try) 2>&5
9300- ac_status=$?
9301- echo "$as_me:$LINENO: \$? = $ac_status" >&5
9302- (exit $ac_status); }; } &&
9303- { ac_try='test -s conftest.$ac_objext'
9304- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9305- (eval $ac_try) 2>&5
9306- ac_status=$?
9307- echo "$as_me:$LINENO: \$? = $ac_status" >&5
9308- (exit $ac_status); }; }; then
9309- for ac_declaration in \
9310- '' \
9311- 'extern "C" void std::exit (int) throw (); using std::exit;' \
9312- 'extern "C" void std::exit (int); using std::exit;' \
9313- 'extern "C" void exit (int) throw ();' \
9314- 'extern "C" void exit (int);' \
9315- 'void exit (int);'
9316-do
9317- cat >conftest.$ac_ext <<_ACEOF
9318-/* confdefs.h. */
9319-_ACEOF
9320-cat confdefs.h >>conftest.$ac_ext
9321-cat >>conftest.$ac_ext <<_ACEOF
9322-/* end confdefs.h. */
9323-$ac_declaration
9324-#include <stdlib.h>
9325-int
9326-main ()
9327-{
9328-exit (42);
9329- ;
9330- return 0;
9331-}
9332-_ACEOF
9333-rm -f conftest.$ac_objext
9334-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
9335- (eval $ac_compile) 2>conftest.er1
9336- ac_status=$?
9337- grep -v '^ *+' conftest.er1 >conftest.err
9338- rm -f conftest.er1
9339- cat conftest.err >&5
9340- echo "$as_me:$LINENO: \$? = $ac_status" >&5
9341- (exit $ac_status); } &&
9342- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
9343- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9344- (eval $ac_try) 2>&5
9345- ac_status=$?
9346- echo "$as_me:$LINENO: \$? = $ac_status" >&5
9347- (exit $ac_status); }; } &&
9348- { ac_try='test -s conftest.$ac_objext'
9349- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9350- (eval $ac_try) 2>&5
9351- ac_status=$?
9352- echo "$as_me:$LINENO: \$? = $ac_status" >&5
9353- (exit $ac_status); }; }; then
9354- :
9355-else
9356- echo "$as_me: failed program was:" >&5
9357-sed 's/^/| /' conftest.$ac_ext >&5
9358-
9359-continue
9360-fi
9361-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
9362- cat >conftest.$ac_ext <<_ACEOF
9363-/* confdefs.h. */
9364-_ACEOF
9365-cat confdefs.h >>conftest.$ac_ext
9366-cat >>conftest.$ac_ext <<_ACEOF
9367-/* end confdefs.h. */
9368-$ac_declaration
9369-int
9370-main ()
9371-{
9372-exit (42);
9373- ;
9374- return 0;
9375-}
9376-_ACEOF
9377-rm -f conftest.$ac_objext
9378-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
9379- (eval $ac_compile) 2>conftest.er1
9380- ac_status=$?
9381- grep -v '^ *+' conftest.er1 >conftest.err
9382- rm -f conftest.er1
9383- cat conftest.err >&5
9384- echo "$as_me:$LINENO: \$? = $ac_status" >&5
9385- (exit $ac_status); } &&
9386- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
9387- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9388- (eval $ac_try) 2>&5
9389- ac_status=$?
9390- echo "$as_me:$LINENO: \$? = $ac_status" >&5
9391- (exit $ac_status); }; } &&
9392- { ac_try='test -s conftest.$ac_objext'
9393- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9394- (eval $ac_try) 2>&5
9395- ac_status=$?
9396- echo "$as_me:$LINENO: \$? = $ac_status" >&5
9397- (exit $ac_status); }; }; then
9398- break
9399-else
9400- echo "$as_me: failed program was:" >&5
9401-sed 's/^/| /' conftest.$ac_ext >&5
9402
9403-fi
9404-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
9405-done
9406-rm -f conftest*
9407-if test -n "$ac_declaration"; then
9408- echo '#ifdef __cplusplus' >>confdefs.h
9409- echo $ac_declaration >>confdefs.h
9410- echo '#endif' >>confdefs.h
9411-fi
9412-
9413-else
9414- echo "$as_me: failed program was:" >&5
9415-sed 's/^/| /' conftest.$ac_ext >&5
9416-
9417-fi
9418-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
9419 ac_ext=c
9420 ac_cpp='$CPP $CPPFLAGS'
9421 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
9422@@ -2679,7 +3147,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
9423 ac_compiler_gnu=$ac_cv_c_compiler_gnu
9424 DEPDIR="${am__leading_dot}deps"
9425
9426- ac_config_commands="$ac_config_commands depfiles"
9427+ac_config_commands="$ac_config_commands depfiles"
9428
9429
9430 am_make=${MAKE-make}
9431@@ -2689,8 +3157,8 @@ am__doit:
9432 .PHONY: am__doit
9433 END
9434 # If we don't find an include directive, just comment out the code.
9435-echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
9436-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
9437+{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
9438+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
9439 am__include="#"
9440 am__quote=
9441 _am_result=none
9442@@ -2717,22 +3185,20 @@ if test "$am__include" = "#"; then
9443 fi
9444
9445
9446-echo "$as_me:$LINENO: result: $_am_result" >&5
9447-echo "${ECHO_T}$_am_result" >&6
9448+{ echo "$as_me:$LINENO: result: $_am_result" >&5
9449+echo "${ECHO_T}$_am_result" >&6; }
9450 rm -f confinc confmf
9451
9452-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
9453+# Check whether --enable-dependency-tracking was given.
9454 if test "${enable_dependency_tracking+set}" = set; then
9455- enableval="$enable_dependency_tracking"
9456+ enableval=$enable_dependency_tracking;
9457+fi
9458
9459-fi;
9460 if test "x$enable_dependency_tracking" != xno; then
9461 am_depcomp="$ac_aux_dir/depcomp"
9462 AMDEPBACKSLASH='\'
9463 fi
9464-
9465-
9466-if test "x$enable_dependency_tracking" != xno; then
9467+ if test "x$enable_dependency_tracking" != xno; then
9468 AMDEP_TRUE=
9469 AMDEP_FALSE='#'
9470 else
9471@@ -2742,11 +3208,10 @@ fi
9472
9473
9474
9475-
9476 depcc="$CC" am_compiler_list=
9477
9478-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
9479-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
9480+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
9481+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
9482 if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
9483 echo $ECHO_N "(cached) $ECHO_C" >&6
9484 else
9485@@ -2810,6 +3275,7 @@ else
9486 depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
9487 $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
9488 >/dev/null 2>conftest.err &&
9489+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
9490 grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
9491 grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
9492 ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
9493@@ -2835,13 +3301,11 @@ else
9494 fi
9495
9496 fi
9497-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
9498-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
9499+{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
9500+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
9501 CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
9502
9503-
9504-
9505-if
9506+ if
9507 test "x$enable_dependency_tracking" != xno \
9508 && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
9509 am__fastdepCC_TRUE=
9510@@ -2862,8 +3326,8 @@ for ac_prog in 'bison -y' byacc
9511 do
9512 # Extract the first word of "$ac_prog", so it can be a program name with args.
9513 set dummy $ac_prog; ac_word=$2
9514-echo "$as_me:$LINENO: checking for $ac_word" >&5
9515-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
9516+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
9517+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
9518 if test "${ac_cv_prog_YACC+set}" = set; then
9519 echo $ECHO_N "(cached) $ECHO_C" >&6
9520 else
9521@@ -2876,40 +3340,61 @@ do
9522 IFS=$as_save_IFS
9523 test -z "$as_dir" && as_dir=.
9524 for ac_exec_ext in '' $ac_executable_extensions; do
9525- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
9526+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
9527 ac_cv_prog_YACC="$ac_prog"
9528 echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
9529 break 2
9530 fi
9531 done
9532 done
9533+IFS=$as_save_IFS
9534
9535 fi
9536 fi
9537 YACC=$ac_cv_prog_YACC
9538 if test -n "$YACC"; then
9539- echo "$as_me:$LINENO: result: $YACC" >&5
9540-echo "${ECHO_T}$YACC" >&6
9541+ { echo "$as_me:$LINENO: result: $YACC" >&5
9542+echo "${ECHO_T}$YACC" >&6; }
9543 else
9544- echo "$as_me:$LINENO: result: no" >&5
9545-echo "${ECHO_T}no" >&6
9546+ { echo "$as_me:$LINENO: result: no" >&5
9547+echo "${ECHO_T}no" >&6; }
9548 fi
9549
9550+
9551 test -n "$YACC" && break
9552 done
9553 test -n "$YACC" || YACC="yacc"
9554
9555
9556-echo "$as_me:$LINENO: checking for build system compiler" >&5
9557-echo $ECHO_N "checking for build system compiler... $ECHO_C" >&6
9558+{ echo "$as_me:$LINENO: checking for build system compiler" >&5
9559+echo $ECHO_N "checking for build system compiler... $ECHO_C" >&6; }
9560 if test "$cross_compiling" = yes; then
9561 CC_FOR_BUILD=${CC_FOR_BUILD-cc}
9562 else
9563 CC_FOR_BUILD=${CC}
9564 fi
9565-echo "$as_me:$LINENO: result: ${CC_FOR_BUILD}" >&5
9566-echo "${ECHO_T}${CC_FOR_BUILD}" >&6
9567+{ echo "$as_me:$LINENO: result: ${CC_FOR_BUILD}" >&5
9568+echo "${ECHO_T}${CC_FOR_BUILD}" >&6; }
9569+
9570+
9571+# Check whether --enable-static was given.
9572+if test "${enable_static+set}" = set; then
9573+ enableval=$enable_static;
9574+fi
9575
9576+if test "$enable_static" = "yes"; then
9577+ export LDFLAGS="-static -Wl,--fatal-warnings"
9578+fi
9579+
9580+# Check whether --enable-fnmatch was given.
9581+if test "${enable_fnmatch+set}" = set; then
9582+ enableval=$enable_fnmatch;
9583+fi
9584+
9585+# Check whether --enable-glob was given.
9586+if test "${enable_glob+set}" = set; then
9587+ enableval=$enable_glob;
9588+fi
9589
9590
9591
9592@@ -2928,13 +3413,16 @@ echo "${ECHO_T}${CC_FOR_BUILD}" >&6
9593
9594
9595
9596-for ac_func in bsearch getpwnam getrlimit isalpha killpg mempcpy sigsetmask \
9597- stpcpy strchrnul strsignal strtod strtoimax strtoumax sysconf
9598+
9599+
9600+for ac_func in bsearch getpwnam getrlimit imaxdiv isalpha killpg mempcpy \
9601+ sigsetmask stpcpy strchrnul strsignal strtod strtoimax \
9602+ strtoumax sysconf
9603 do
9604 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
9605-echo "$as_me:$LINENO: checking for $ac_func" >&5
9606-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
9607-if eval "test \"\${$as_ac_var+set}\" = set"; then
9608+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
9609+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
9610+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
9611 echo $ECHO_N "(cached) $ECHO_C" >&6
9612 else
9613 cat >conftest.$ac_ext <<_ACEOF
9614@@ -2960,67 +3448,254 @@ cat >>conftest.$ac_ext <<_ACEOF
9615
9616 #undef $ac_func
9617
9618-/* Override any gcc2 internal prototype to avoid an error. */
9619+/* Override any GCC internal prototype to avoid an error.
9620+ Use char because int might match the return type of a GCC
9621+ builtin and then its argument prototype would still apply. */
9622 #ifdef __cplusplus
9623 extern "C"
9624-{
9625 #endif
9626-/* We use char because int might match the return type of a gcc2
9627- builtin and then its argument prototype would still apply. */
9628 char $ac_func ();
9629 /* The GNU C library defines this for functions which it implements
9630 to always fail with ENOSYS. Some functions are actually named
9631 something starting with __ and the normal name is an alias. */
9632-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
9633+#if defined __stub_$ac_func || defined __stub___$ac_func
9634 choke me
9635+#endif
9636+
9637+int
9638+main ()
9639+{
9640+return $ac_func ();
9641+ ;
9642+ return 0;
9643+}
9644+_ACEOF
9645+rm -f conftest.$ac_objext conftest$ac_exeext
9646+if { (ac_try="$ac_link"
9647+case "(($ac_try" in
9648+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9649+ *) ac_try_echo=$ac_try;;
9650+esac
9651+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9652+ (eval "$ac_link") 2>conftest.er1
9653+ ac_status=$?
9654+ grep -v '^ *+' conftest.er1 >conftest.err
9655+ rm -f conftest.er1
9656+ cat conftest.err >&5
9657+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
9658+ (exit $ac_status); } && {
9659+ test -z "$ac_c_werror_flag" ||
9660+ test ! -s conftest.err
9661+ } && test -s conftest$ac_exeext &&
9662+ $as_test_x conftest$ac_exeext; then
9663+ eval "$as_ac_var=yes"
9664+else
9665+ echo "$as_me: failed program was:" >&5
9666+sed 's/^/| /' conftest.$ac_ext >&5
9667+
9668+ eval "$as_ac_var=no"
9669+fi
9670+
9671+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
9672+ conftest$ac_exeext conftest.$ac_ext
9673+fi
9674+ac_res=`eval echo '${'$as_ac_var'}'`
9675+ { echo "$as_me:$LINENO: result: $ac_res" >&5
9676+echo "${ECHO_T}$ac_res" >&6; }
9677+if test `eval echo '${'$as_ac_var'}'` = yes; then
9678+ cat >>confdefs.h <<_ACEOF
9679+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
9680+_ACEOF
9681+
9682+fi
9683+done
9684+
9685+
9686+if test "$enable_fnmatch" = yes; then
9687+ use_fnmatch=
9688+
9689+for ac_func in fnmatch
9690+do
9691+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
9692+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
9693+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
9694+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
9695+ echo $ECHO_N "(cached) $ECHO_C" >&6
9696+else
9697+ cat >conftest.$ac_ext <<_ACEOF
9698+/* confdefs.h. */
9699+_ACEOF
9700+cat confdefs.h >>conftest.$ac_ext
9701+cat >>conftest.$ac_ext <<_ACEOF
9702+/* end confdefs.h. */
9703+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
9704+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
9705+#define $ac_func innocuous_$ac_func
9706+
9707+/* System header to define __stub macros and hopefully few prototypes,
9708+ which can conflict with char $ac_func (); below.
9709+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
9710+ <limits.h> exists even on freestanding compilers. */
9711+
9712+#ifdef __STDC__
9713+# include <limits.h>
9714 #else
9715-char (*f) () = $ac_func;
9716+# include <assert.h>
9717 #endif
9718+
9719+#undef $ac_func
9720+
9721+/* Override any GCC internal prototype to avoid an error.
9722+ Use char because int might match the return type of a GCC
9723+ builtin and then its argument prototype would still apply. */
9724 #ifdef __cplusplus
9725-}
9726+extern "C"
9727+#endif
9728+char $ac_func ();
9729+/* The GNU C library defines this for functions which it implements
9730+ to always fail with ENOSYS. Some functions are actually named
9731+ something starting with __ and the normal name is an alias. */
9732+#if defined __stub_$ac_func || defined __stub___$ac_func
9733+choke me
9734 #endif
9735
9736 int
9737 main ()
9738 {
9739-return f != $ac_func;
9740+return $ac_func ();
9741 ;
9742 return 0;
9743 }
9744 _ACEOF
9745 rm -f conftest.$ac_objext conftest$ac_exeext
9746-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
9747- (eval $ac_link) 2>conftest.er1
9748+if { (ac_try="$ac_link"
9749+case "(($ac_try" in
9750+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9751+ *) ac_try_echo=$ac_try;;
9752+esac
9753+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9754+ (eval "$ac_link") 2>conftest.er1
9755 ac_status=$?
9756 grep -v '^ *+' conftest.er1 >conftest.err
9757 rm -f conftest.er1
9758 cat conftest.err >&5
9759 echo "$as_me:$LINENO: \$? = $ac_status" >&5
9760- (exit $ac_status); } &&
9761- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
9762- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9763- (eval $ac_try) 2>&5
9764- ac_status=$?
9765- echo "$as_me:$LINENO: \$? = $ac_status" >&5
9766- (exit $ac_status); }; } &&
9767- { ac_try='test -s conftest$ac_exeext'
9768- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9769- (eval $ac_try) 2>&5
9770+ (exit $ac_status); } && {
9771+ test -z "$ac_c_werror_flag" ||
9772+ test ! -s conftest.err
9773+ } && test -s conftest$ac_exeext &&
9774+ $as_test_x conftest$ac_exeext; then
9775+ eval "$as_ac_var=yes"
9776+else
9777+ echo "$as_me: failed program was:" >&5
9778+sed 's/^/| /' conftest.$ac_ext >&5
9779+
9780+ eval "$as_ac_var=no"
9781+fi
9782+
9783+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
9784+ conftest$ac_exeext conftest.$ac_ext
9785+fi
9786+ac_res=`eval echo '${'$as_ac_var'}'`
9787+ { echo "$as_me:$LINENO: result: $ac_res" >&5
9788+echo "${ECHO_T}$ac_res" >&6; }
9789+if test `eval echo '${'$as_ac_var'}'` = yes; then
9790+ cat >>confdefs.h <<_ACEOF
9791+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
9792+_ACEOF
9793+ use_fnmatch=yes
9794+fi
9795+done
9796+
9797+fi
9798+
9799+if test "$use_fnmatch" = yes && test "$enable_glob" = yes; then
9800+
9801+for ac_func in glob
9802+do
9803+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
9804+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
9805+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
9806+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
9807+ echo $ECHO_N "(cached) $ECHO_C" >&6
9808+else
9809+ cat >conftest.$ac_ext <<_ACEOF
9810+/* confdefs.h. */
9811+_ACEOF
9812+cat confdefs.h >>conftest.$ac_ext
9813+cat >>conftest.$ac_ext <<_ACEOF
9814+/* end confdefs.h. */
9815+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
9816+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
9817+#define $ac_func innocuous_$ac_func
9818+
9819+/* System header to define __stub macros and hopefully few prototypes,
9820+ which can conflict with char $ac_func (); below.
9821+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
9822+ <limits.h> exists even on freestanding compilers. */
9823+
9824+#ifdef __STDC__
9825+# include <limits.h>
9826+#else
9827+# include <assert.h>
9828+#endif
9829+
9830+#undef $ac_func
9831+
9832+/* Override any GCC internal prototype to avoid an error.
9833+ Use char because int might match the return type of a GCC
9834+ builtin and then its argument prototype would still apply. */
9835+#ifdef __cplusplus
9836+extern "C"
9837+#endif
9838+char $ac_func ();
9839+/* The GNU C library defines this for functions which it implements
9840+ to always fail with ENOSYS. Some functions are actually named
9841+ something starting with __ and the normal name is an alias. */
9842+#if defined __stub_$ac_func || defined __stub___$ac_func
9843+choke me
9844+#endif
9845+
9846+int
9847+main ()
9848+{
9849+return $ac_func ();
9850+ ;
9851+ return 0;
9852+}
9853+_ACEOF
9854+rm -f conftest.$ac_objext conftest$ac_exeext
9855+if { (ac_try="$ac_link"
9856+case "(($ac_try" in
9857+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9858+ *) ac_try_echo=$ac_try;;
9859+esac
9860+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9861+ (eval "$ac_link") 2>conftest.er1
9862 ac_status=$?
9863+ grep -v '^ *+' conftest.er1 >conftest.err
9864+ rm -f conftest.er1
9865+ cat conftest.err >&5
9866 echo "$as_me:$LINENO: \$? = $ac_status" >&5
9867- (exit $ac_status); }; }; then
9868+ (exit $ac_status); } && {
9869+ test -z "$ac_c_werror_flag" ||
9870+ test ! -s conftest.err
9871+ } && test -s conftest$ac_exeext &&
9872+ $as_test_x conftest$ac_exeext; then
9873 eval "$as_ac_var=yes"
9874 else
9875 echo "$as_me: failed program was:" >&5
9876 sed 's/^/| /' conftest.$ac_ext >&5
9877
9878-eval "$as_ac_var=no"
9879+ eval "$as_ac_var=no"
9880 fi
9881-rm -f conftest.err conftest.$ac_objext \
9882+
9883+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
9884 conftest$ac_exeext conftest.$ac_ext
9885 fi
9886-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
9887-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
9888+ac_res=`eval echo '${'$as_ac_var'}'`
9889+ { echo "$as_me:$LINENO: result: $ac_res" >&5
9890+echo "${ECHO_T}$ac_res" >&6; }
9891 if test `eval echo '${'$as_ac_var'}'` = yes; then
9892 cat >>confdefs.h <<_ACEOF
9893 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
9894@@ -3029,9 +3704,10 @@ _ACEOF
9895 fi
9896 done
9897
9898+fi
9899
9900-echo "$as_me:$LINENO: checking for signal" >&5
9901-echo $ECHO_N "checking for signal... $ECHO_C" >&6
9902+{ echo "$as_me:$LINENO: checking for signal" >&5
9903+echo $ECHO_N "checking for signal... $ECHO_C" >&6; }
9904 if test "${ac_cv_func_signal+set}" = set; then
9905 echo $ECHO_N "(cached) $ECHO_C" >&6
9906 else
9907@@ -3058,71 +3734,63 @@ cat >>conftest.$ac_ext <<_ACEOF
9908
9909 #undef signal
9910
9911-/* Override any gcc2 internal prototype to avoid an error. */
9912+/* Override any GCC internal prototype to avoid an error.
9913+ Use char because int might match the return type of a GCC
9914+ builtin and then its argument prototype would still apply. */
9915 #ifdef __cplusplus
9916 extern "C"
9917-{
9918 #endif
9919-/* We use char because int might match the return type of a gcc2
9920- builtin and then its argument prototype would still apply. */
9921 char signal ();
9922 /* The GNU C library defines this for functions which it implements
9923 to always fail with ENOSYS. Some functions are actually named
9924 something starting with __ and the normal name is an alias. */
9925-#if defined (__stub_signal) || defined (__stub___signal)
9926+#if defined __stub_signal || defined __stub___signal
9927 choke me
9928-#else
9929-char (*f) () = signal;
9930-#endif
9931-#ifdef __cplusplus
9932-}
9933 #endif
9934
9935 int
9936 main ()
9937 {
9938-return f != signal;
9939+return signal ();
9940 ;
9941 return 0;
9942 }
9943 _ACEOF
9944 rm -f conftest.$ac_objext conftest$ac_exeext
9945-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
9946- (eval $ac_link) 2>conftest.er1
9947+if { (ac_try="$ac_link"
9948+case "(($ac_try" in
9949+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
9950+ *) ac_try_echo=$ac_try;;
9951+esac
9952+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
9953+ (eval "$ac_link") 2>conftest.er1
9954 ac_status=$?
9955 grep -v '^ *+' conftest.er1 >conftest.err
9956 rm -f conftest.er1
9957 cat conftest.err >&5
9958 echo "$as_me:$LINENO: \$? = $ac_status" >&5
9959- (exit $ac_status); } &&
9960- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
9961- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9962- (eval $ac_try) 2>&5
9963- ac_status=$?
9964- echo "$as_me:$LINENO: \$? = $ac_status" >&5
9965- (exit $ac_status); }; } &&
9966- { ac_try='test -s conftest$ac_exeext'
9967- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
9968- (eval $ac_try) 2>&5
9969- ac_status=$?
9970- echo "$as_me:$LINENO: \$? = $ac_status" >&5
9971- (exit $ac_status); }; }; then
9972+ (exit $ac_status); } && {
9973+ test -z "$ac_c_werror_flag" ||
9974+ test ! -s conftest.err
9975+ } && test -s conftest$ac_exeext &&
9976+ $as_test_x conftest$ac_exeext; then
9977 ac_cv_func_signal=yes
9978 else
9979 echo "$as_me: failed program was:" >&5
9980 sed 's/^/| /' conftest.$ac_ext >&5
9981
9982-ac_cv_func_signal=no
9983+ ac_cv_func_signal=no
9984 fi
9985-rm -f conftest.err conftest.$ac_objext \
9986+
9987+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
9988 conftest$ac_exeext conftest.$ac_ext
9989 fi
9990-echo "$as_me:$LINENO: result: $ac_cv_func_signal" >&5
9991-echo "${ECHO_T}$ac_cv_func_signal" >&6
9992+{ echo "$as_me:$LINENO: result: $ac_cv_func_signal" >&5
9993+echo "${ECHO_T}$ac_cv_func_signal" >&6; }
9994
9995 if test "$ac_cv_func_signal" != yes; then
9996- echo "$as_me:$LINENO: checking for bsd_signal" >&5
9997-echo $ECHO_N "checking for bsd_signal... $ECHO_C" >&6
9998+ { echo "$as_me:$LINENO: checking for bsd_signal" >&5
9999+echo $ECHO_N "checking for bsd_signal... $ECHO_C" >&6; }
10000 if test "${ac_cv_func_bsd_signal+set}" = set; then
10001 echo $ECHO_N "(cached) $ECHO_C" >&6
10002 else
10003@@ -3149,67 +3817,59 @@ cat >>conftest.$ac_ext <<_ACEOF
10004
10005 #undef bsd_signal
10006
10007-/* Override any gcc2 internal prototype to avoid an error. */
10008+/* Override any GCC internal prototype to avoid an error.
10009+ Use char because int might match the return type of a GCC
10010+ builtin and then its argument prototype would still apply. */
10011 #ifdef __cplusplus
10012 extern "C"
10013-{
10014 #endif
10015-/* We use char because int might match the return type of a gcc2
10016- builtin and then its argument prototype would still apply. */
10017 char bsd_signal ();
10018 /* The GNU C library defines this for functions which it implements
10019 to always fail with ENOSYS. Some functions are actually named
10020 something starting with __ and the normal name is an alias. */
10021-#if defined (__stub_bsd_signal) || defined (__stub___bsd_signal)
10022+#if defined __stub_bsd_signal || defined __stub___bsd_signal
10023 choke me
10024-#else
10025-char (*f) () = bsd_signal;
10026-#endif
10027-#ifdef __cplusplus
10028-}
10029 #endif
10030
10031 int
10032 main ()
10033 {
10034-return f != bsd_signal;
10035+return bsd_signal ();
10036 ;
10037 return 0;
10038 }
10039 _ACEOF
10040 rm -f conftest.$ac_objext conftest$ac_exeext
10041-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
10042- (eval $ac_link) 2>conftest.er1
10043+if { (ac_try="$ac_link"
10044+case "(($ac_try" in
10045+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10046+ *) ac_try_echo=$ac_try;;
10047+esac
10048+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10049+ (eval "$ac_link") 2>conftest.er1
10050 ac_status=$?
10051 grep -v '^ *+' conftest.er1 >conftest.err
10052 rm -f conftest.er1
10053 cat conftest.err >&5
10054 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10055- (exit $ac_status); } &&
10056- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
10057- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10058- (eval $ac_try) 2>&5
10059- ac_status=$?
10060- echo "$as_me:$LINENO: \$? = $ac_status" >&5
10061- (exit $ac_status); }; } &&
10062- { ac_try='test -s conftest$ac_exeext'
10063- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10064- (eval $ac_try) 2>&5
10065- ac_status=$?
10066- echo "$as_me:$LINENO: \$? = $ac_status" >&5
10067- (exit $ac_status); }; }; then
10068+ (exit $ac_status); } && {
10069+ test -z "$ac_c_werror_flag" ||
10070+ test ! -s conftest.err
10071+ } && test -s conftest$ac_exeext &&
10072+ $as_test_x conftest$ac_exeext; then
10073 ac_cv_func_bsd_signal=yes
10074 else
10075 echo "$as_me: failed program was:" >&5
10076 sed 's/^/| /' conftest.$ac_ext >&5
10077
10078-ac_cv_func_bsd_signal=no
10079+ ac_cv_func_bsd_signal=no
10080 fi
10081-rm -f conftest.err conftest.$ac_objext \
10082+
10083+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
10084 conftest$ac_exeext conftest.$ac_ext
10085 fi
10086-echo "$as_me:$LINENO: result: $ac_cv_func_bsd_signal" >&5
10087-echo "${ECHO_T}$ac_cv_func_bsd_signal" >&6
10088+{ echo "$as_me:$LINENO: result: $ac_cv_func_bsd_signal" >&5
10089+echo "${ECHO_T}$ac_cv_func_bsd_signal" >&6; }
10090 if test $ac_cv_func_bsd_signal = yes; then
10091
10092 cat >>confdefs.h <<\_ACEOF
10093@@ -3220,8 +3880,8 @@ fi
10094
10095 fi
10096
10097-echo "$as_me:$LINENO: checking for stat64" >&5
10098-echo $ECHO_N "checking for stat64... $ECHO_C" >&6
10099+{ echo "$as_me:$LINENO: checking for stat64" >&5
10100+echo $ECHO_N "checking for stat64... $ECHO_C" >&6; }
10101 if test "${ac_cv_func_stat64+set}" = set; then
10102 echo $ECHO_N "(cached) $ECHO_C" >&6
10103 else
10104@@ -3248,67 +3908,59 @@ cat >>conftest.$ac_ext <<_ACEOF
10105
10106 #undef stat64
10107
10108-/* Override any gcc2 internal prototype to avoid an error. */
10109+/* Override any GCC internal prototype to avoid an error.
10110+ Use char because int might match the return type of a GCC
10111+ builtin and then its argument prototype would still apply. */
10112 #ifdef __cplusplus
10113 extern "C"
10114-{
10115 #endif
10116-/* We use char because int might match the return type of a gcc2
10117- builtin and then its argument prototype would still apply. */
10118 char stat64 ();
10119 /* The GNU C library defines this for functions which it implements
10120 to always fail with ENOSYS. Some functions are actually named
10121 something starting with __ and the normal name is an alias. */
10122-#if defined (__stub_stat64) || defined (__stub___stat64)
10123+#if defined __stub_stat64 || defined __stub___stat64
10124 choke me
10125-#else
10126-char (*f) () = stat64;
10127-#endif
10128-#ifdef __cplusplus
10129-}
10130 #endif
10131
10132 int
10133 main ()
10134 {
10135-return f != stat64;
10136+return stat64 ();
10137 ;
10138 return 0;
10139 }
10140 _ACEOF
10141 rm -f conftest.$ac_objext conftest$ac_exeext
10142-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
10143- (eval $ac_link) 2>conftest.er1
10144+if { (ac_try="$ac_link"
10145+case "(($ac_try" in
10146+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10147+ *) ac_try_echo=$ac_try;;
10148+esac
10149+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10150+ (eval "$ac_link") 2>conftest.er1
10151 ac_status=$?
10152 grep -v '^ *+' conftest.er1 >conftest.err
10153 rm -f conftest.er1
10154 cat conftest.err >&5
10155 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10156- (exit $ac_status); } &&
10157- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
10158- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10159- (eval $ac_try) 2>&5
10160- ac_status=$?
10161- echo "$as_me:$LINENO: \$? = $ac_status" >&5
10162- (exit $ac_status); }; } &&
10163- { ac_try='test -s conftest$ac_exeext'
10164- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10165- (eval $ac_try) 2>&5
10166- ac_status=$?
10167- echo "$as_me:$LINENO: \$? = $ac_status" >&5
10168- (exit $ac_status); }; }; then
10169+ (exit $ac_status); } && {
10170+ test -z "$ac_c_werror_flag" ||
10171+ test ! -s conftest.err
10172+ } && test -s conftest$ac_exeext &&
10173+ $as_test_x conftest$ac_exeext; then
10174 ac_cv_func_stat64=yes
10175 else
10176 echo "$as_me: failed program was:" >&5
10177 sed 's/^/| /' conftest.$ac_ext >&5
10178
10179-ac_cv_func_stat64=no
10180+ ac_cv_func_stat64=no
10181 fi
10182-rm -f conftest.err conftest.$ac_objext \
10183+
10184+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
10185 conftest$ac_exeext conftest.$ac_ext
10186 fi
10187-echo "$as_me:$LINENO: result: $ac_cv_func_stat64" >&5
10188-echo "${ECHO_T}$ac_cv_func_stat64" >&6
10189+{ echo "$as_me:$LINENO: result: $ac_cv_func_stat64" >&5
10190+echo "${ECHO_T}$ac_cv_func_stat64" >&6; }
10191 if test $ac_cv_func_stat64 = yes; then
10192 :
10193 else
10194@@ -3338,11 +3990,11 @@ fi
10195
10196
10197
10198-# Check whether --with-libedit or --without-libedit was given.
10199+# Check whether --with-libedit was given.
10200 if test "${with_libedit+set}" = set; then
10201- withval="$with_libedit"
10202+ withval=$with_libedit;
10203+fi
10204
10205-fi;
10206 use_libedit=
10207 if test "$with_libedit" = "yes"; then
10208 ac_ext=c
10209@@ -3350,8 +4002,8 @@ ac_cpp='$CPP $CPPFLAGS'
10210 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
10211 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
10212 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10213-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
10214-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
10215+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
10216+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
10217 # On Suns, sometimes $CPP names a directory.
10218 if test -n "$CPP" && test -d "$CPP"; then
10219 CPP=
10220@@ -3385,24 +4037,22 @@ cat >>conftest.$ac_ext <<_ACEOF
10221 #endif
10222 Syntax error
10223 _ACEOF
10224-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
10225- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10226+if { (ac_try="$ac_cpp conftest.$ac_ext"
10227+case "(($ac_try" in
10228+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10229+ *) ac_try_echo=$ac_try;;
10230+esac
10231+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10232+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
10233 ac_status=$?
10234 grep -v '^ *+' conftest.er1 >conftest.err
10235 rm -f conftest.er1
10236 cat conftest.err >&5
10237 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10238- (exit $ac_status); } >/dev/null; then
10239- if test -s conftest.err; then
10240- ac_cpp_err=$ac_c_preproc_warn_flag
10241- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
10242- else
10243- ac_cpp_err=
10244- fi
10245-else
10246- ac_cpp_err=yes
10247-fi
10248-if test -z "$ac_cpp_err"; then
10249+ (exit $ac_status); } >/dev/null && {
10250+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
10251+ test ! -s conftest.err
10252+ }; then
10253 :
10254 else
10255 echo "$as_me: failed program was:" >&5
10256@@ -3411,9 +4061,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
10257 # Broken: fails on valid input.
10258 continue
10259 fi
10260+
10261 rm -f conftest.err conftest.$ac_ext
10262
10263- # OK, works on sane cases. Now check whether non-existent headers
10264+ # OK, works on sane cases. Now check whether nonexistent headers
10265 # can be detected and how.
10266 cat >conftest.$ac_ext <<_ACEOF
10267 /* confdefs.h. */
10268@@ -3423,24 +4074,22 @@ cat >>conftest.$ac_ext <<_ACEOF
10269 /* end confdefs.h. */
10270 #include <ac_nonexistent.h>
10271 _ACEOF
10272-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
10273- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10274+if { (ac_try="$ac_cpp conftest.$ac_ext"
10275+case "(($ac_try" in
10276+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10277+ *) ac_try_echo=$ac_try;;
10278+esac
10279+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10280+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
10281 ac_status=$?
10282 grep -v '^ *+' conftest.er1 >conftest.err
10283 rm -f conftest.er1
10284 cat conftest.err >&5
10285 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10286- (exit $ac_status); } >/dev/null; then
10287- if test -s conftest.err; then
10288- ac_cpp_err=$ac_c_preproc_warn_flag
10289- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
10290- else
10291- ac_cpp_err=
10292- fi
10293-else
10294- ac_cpp_err=yes
10295-fi
10296-if test -z "$ac_cpp_err"; then
10297+ (exit $ac_status); } >/dev/null && {
10298+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
10299+ test ! -s conftest.err
10300+ }; then
10301 # Broken: success on invalid input.
10302 continue
10303 else
10304@@ -3451,6 +4100,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
10305 ac_preproc_ok=:
10306 break
10307 fi
10308+
10309 rm -f conftest.err conftest.$ac_ext
10310
10311 done
10312@@ -3468,8 +4118,8 @@ fi
10313 else
10314 ac_cv_prog_CPP=$CPP
10315 fi
10316-echo "$as_me:$LINENO: result: $CPP" >&5
10317-echo "${ECHO_T}$CPP" >&6
10318+{ echo "$as_me:$LINENO: result: $CPP" >&5
10319+echo "${ECHO_T}$CPP" >&6; }
10320 ac_preproc_ok=false
10321 for ac_c_preproc_warn_flag in '' yes
10322 do
10323@@ -3492,24 +4142,22 @@ cat >>conftest.$ac_ext <<_ACEOF
10324 #endif
10325 Syntax error
10326 _ACEOF
10327-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
10328- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10329+if { (ac_try="$ac_cpp conftest.$ac_ext"
10330+case "(($ac_try" in
10331+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10332+ *) ac_try_echo=$ac_try;;
10333+esac
10334+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10335+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
10336 ac_status=$?
10337 grep -v '^ *+' conftest.er1 >conftest.err
10338 rm -f conftest.er1
10339 cat conftest.err >&5
10340 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10341- (exit $ac_status); } >/dev/null; then
10342- if test -s conftest.err; then
10343- ac_cpp_err=$ac_c_preproc_warn_flag
10344- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
10345- else
10346- ac_cpp_err=
10347- fi
10348-else
10349- ac_cpp_err=yes
10350-fi
10351-if test -z "$ac_cpp_err"; then
10352+ (exit $ac_status); } >/dev/null && {
10353+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
10354+ test ! -s conftest.err
10355+ }; then
10356 :
10357 else
10358 echo "$as_me: failed program was:" >&5
10359@@ -3518,9 +4166,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
10360 # Broken: fails on valid input.
10361 continue
10362 fi
10363+
10364 rm -f conftest.err conftest.$ac_ext
10365
10366- # OK, works on sane cases. Now check whether non-existent headers
10367+ # OK, works on sane cases. Now check whether nonexistent headers
10368 # can be detected and how.
10369 cat >conftest.$ac_ext <<_ACEOF
10370 /* confdefs.h. */
10371@@ -3530,24 +4179,22 @@ cat >>conftest.$ac_ext <<_ACEOF
10372 /* end confdefs.h. */
10373 #include <ac_nonexistent.h>
10374 _ACEOF
10375-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
10376- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10377+if { (ac_try="$ac_cpp conftest.$ac_ext"
10378+case "(($ac_try" in
10379+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10380+ *) ac_try_echo=$ac_try;;
10381+esac
10382+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10383+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
10384 ac_status=$?
10385 grep -v '^ *+' conftest.er1 >conftest.err
10386 rm -f conftest.er1
10387 cat conftest.err >&5
10388 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10389- (exit $ac_status); } >/dev/null; then
10390- if test -s conftest.err; then
10391- ac_cpp_err=$ac_c_preproc_warn_flag
10392- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
10393- else
10394- ac_cpp_err=
10395- fi
10396-else
10397- ac_cpp_err=yes
10398-fi
10399-if test -z "$ac_cpp_err"; then
10400+ (exit $ac_status); } >/dev/null && {
10401+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
10402+ test ! -s conftest.err
10403+ }; then
10404 # Broken: success on invalid input.
10405 continue
10406 else
10407@@ -3558,6 +4205,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
10408 ac_preproc_ok=:
10409 break
10410 fi
10411+
10412 rm -f conftest.err conftest.$ac_ext
10413
10414 done
10415@@ -3580,23 +4228,170 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
10416 ac_compiler_gnu=$ac_cv_c_compiler_gnu
10417
10418
10419-echo "$as_me:$LINENO: checking for egrep" >&5
10420-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
10421-if test "${ac_cv_prog_egrep+set}" = set; then
10422+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
10423+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
10424+if test "${ac_cv_path_GREP+set}" = set; then
10425+ echo $ECHO_N "(cached) $ECHO_C" >&6
10426+else
10427+ # Extract the first word of "grep ggrep" to use in msg output
10428+if test -z "$GREP"; then
10429+set dummy grep ggrep; ac_prog_name=$2
10430+if test "${ac_cv_path_GREP+set}" = set; then
10431+ echo $ECHO_N "(cached) $ECHO_C" >&6
10432+else
10433+ ac_path_GREP_found=false
10434+# Loop through the user's path and test for each of PROGNAME-LIST
10435+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10436+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
10437+do
10438+ IFS=$as_save_IFS
10439+ test -z "$as_dir" && as_dir=.
10440+ for ac_prog in grep ggrep; do
10441+ for ac_exec_ext in '' $ac_executable_extensions; do
10442+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
10443+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
10444+ # Check for GNU ac_path_GREP and select it if it is found.
10445+ # Check for GNU $ac_path_GREP
10446+case `"$ac_path_GREP" --version 2>&1` in
10447+*GNU*)
10448+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
10449+*)
10450+ ac_count=0
10451+ echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
10452+ while :
10453+ do
10454+ cat "conftest.in" "conftest.in" >"conftest.tmp"
10455+ mv "conftest.tmp" "conftest.in"
10456+ cp "conftest.in" "conftest.nl"
10457+ echo 'GREP' >> "conftest.nl"
10458+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
10459+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
10460+ ac_count=`expr $ac_count + 1`
10461+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
10462+ # Best one so far, save it but keep looking for a better one
10463+ ac_cv_path_GREP="$ac_path_GREP"
10464+ ac_path_GREP_max=$ac_count
10465+ fi
10466+ # 10*(2^10) chars as input seems more than enough
10467+ test $ac_count -gt 10 && break
10468+ done
10469+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
10470+esac
10471+
10472+
10473+ $ac_path_GREP_found && break 3
10474+ done
10475+done
10476+
10477+done
10478+IFS=$as_save_IFS
10479+
10480+
10481+fi
10482+
10483+GREP="$ac_cv_path_GREP"
10484+if test -z "$GREP"; then
10485+ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
10486+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
10487+ { (exit 1); exit 1; }; }
10488+fi
10489+
10490+else
10491+ ac_cv_path_GREP=$GREP
10492+fi
10493+
10494+
10495+fi
10496+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
10497+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
10498+ GREP="$ac_cv_path_GREP"
10499+
10500+
10501+{ echo "$as_me:$LINENO: checking for egrep" >&5
10502+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
10503+if test "${ac_cv_path_EGREP+set}" = set; then
10504 echo $ECHO_N "(cached) $ECHO_C" >&6
10505 else
10506- if echo a | (grep -E '(a|b)') >/dev/null 2>&1
10507- then ac_cv_prog_egrep='grep -E'
10508- else ac_cv_prog_egrep='egrep'
10509+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
10510+ then ac_cv_path_EGREP="$GREP -E"
10511+ else
10512+ # Extract the first word of "egrep" to use in msg output
10513+if test -z "$EGREP"; then
10514+set dummy egrep; ac_prog_name=$2
10515+if test "${ac_cv_path_EGREP+set}" = set; then
10516+ echo $ECHO_N "(cached) $ECHO_C" >&6
10517+else
10518+ ac_path_EGREP_found=false
10519+# Loop through the user's path and test for each of PROGNAME-LIST
10520+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
10521+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
10522+do
10523+ IFS=$as_save_IFS
10524+ test -z "$as_dir" && as_dir=.
10525+ for ac_prog in egrep; do
10526+ for ac_exec_ext in '' $ac_executable_extensions; do
10527+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
10528+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
10529+ # Check for GNU ac_path_EGREP and select it if it is found.
10530+ # Check for GNU $ac_path_EGREP
10531+case `"$ac_path_EGREP" --version 2>&1` in
10532+*GNU*)
10533+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
10534+*)
10535+ ac_count=0
10536+ echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
10537+ while :
10538+ do
10539+ cat "conftest.in" "conftest.in" >"conftest.tmp"
10540+ mv "conftest.tmp" "conftest.in"
10541+ cp "conftest.in" "conftest.nl"
10542+ echo 'EGREP' >> "conftest.nl"
10543+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
10544+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
10545+ ac_count=`expr $ac_count + 1`
10546+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
10547+ # Best one so far, save it but keep looking for a better one
10548+ ac_cv_path_EGREP="$ac_path_EGREP"
10549+ ac_path_EGREP_max=$ac_count
10550 fi
10551+ # 10*(2^10) chars as input seems more than enough
10552+ test $ac_count -gt 10 && break
10553+ done
10554+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
10555+esac
10556+
10557+
10558+ $ac_path_EGREP_found && break 3
10559+ done
10560+done
10561+
10562+done
10563+IFS=$as_save_IFS
10564+
10565+
10566+fi
10567+
10568+EGREP="$ac_cv_path_EGREP"
10569+if test -z "$EGREP"; then
10570+ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
10571+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
10572+ { (exit 1); exit 1; }; }
10573+fi
10574+
10575+else
10576+ ac_cv_path_EGREP=$EGREP
10577+fi
10578+
10579+
10580+ fi
10581 fi
10582-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
10583-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
10584- EGREP=$ac_cv_prog_egrep
10585+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
10586+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
10587+ EGREP="$ac_cv_path_EGREP"
10588
10589
10590-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
10591-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
10592+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
10593+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
10594 if test "${ac_cv_header_stdc+set}" = set; then
10595 echo $ECHO_N "(cached) $ECHO_C" >&6
10596 else
10597@@ -3620,34 +4415,31 @@ main ()
10598 }
10599 _ACEOF
10600 rm -f conftest.$ac_objext
10601-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10602- (eval $ac_compile) 2>conftest.er1
10603+if { (ac_try="$ac_compile"
10604+case "(($ac_try" in
10605+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10606+ *) ac_try_echo=$ac_try;;
10607+esac
10608+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10609+ (eval "$ac_compile") 2>conftest.er1
10610 ac_status=$?
10611 grep -v '^ *+' conftest.er1 >conftest.err
10612 rm -f conftest.er1
10613 cat conftest.err >&5
10614 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10615- (exit $ac_status); } &&
10616- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
10617- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10618- (eval $ac_try) 2>&5
10619- ac_status=$?
10620- echo "$as_me:$LINENO: \$? = $ac_status" >&5
10621- (exit $ac_status); }; } &&
10622- { ac_try='test -s conftest.$ac_objext'
10623- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10624- (eval $ac_try) 2>&5
10625- ac_status=$?
10626- echo "$as_me:$LINENO: \$? = $ac_status" >&5
10627- (exit $ac_status); }; }; then
10628+ (exit $ac_status); } && {
10629+ test -z "$ac_c_werror_flag" ||
10630+ test ! -s conftest.err
10631+ } && test -s conftest.$ac_objext; then
10632 ac_cv_header_stdc=yes
10633 else
10634 echo "$as_me: failed program was:" >&5
10635 sed 's/^/| /' conftest.$ac_ext >&5
10636
10637-ac_cv_header_stdc=no
10638+ ac_cv_header_stdc=no
10639 fi
10640-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10641+
10642+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10643
10644 if test $ac_cv_header_stdc = yes; then
10645 # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
10646@@ -3703,6 +4495,7 @@ cat confdefs.h >>conftest.$ac_ext
10647 cat >>conftest.$ac_ext <<_ACEOF
10648 /* end confdefs.h. */
10649 #include <ctype.h>
10650+#include <stdlib.h>
10651 #if ((' ' & 0x0FF) == 0x020)
10652 # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
10653 # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
10654@@ -3722,18 +4515,27 @@ main ()
10655 for (i = 0; i < 256; i++)
10656 if (XOR (islower (i), ISLOWER (i))
10657 || toupper (i) != TOUPPER (i))
10658- exit(2);
10659- exit (0);
10660+ return 2;
10661+ return 0;
10662 }
10663 _ACEOF
10664 rm -f conftest$ac_exeext
10665-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
10666- (eval $ac_link) 2>&5
10667+if { (ac_try="$ac_link"
10668+case "(($ac_try" in
10669+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10670+ *) ac_try_echo=$ac_try;;
10671+esac
10672+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10673+ (eval "$ac_link") 2>&5
10674 ac_status=$?
10675 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10676 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
10677- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10678- (eval $ac_try) 2>&5
10679+ { (case "(($ac_try" in
10680+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10681+ *) ac_try_echo=$ac_try;;
10682+esac
10683+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10684+ (eval "$ac_try") 2>&5
10685 ac_status=$?
10686 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10687 (exit $ac_status); }; }; then
10688@@ -3746,12 +4548,14 @@ sed 's/^/| /' conftest.$ac_ext >&5
10689 ( exit $ac_status )
10690 ac_cv_header_stdc=no
10691 fi
10692-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10693+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
10694 fi
10695+
10696+
10697 fi
10698 fi
10699-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
10700-echo "${ECHO_T}$ac_cv_header_stdc" >&6
10701+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
10702+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
10703 if test $ac_cv_header_stdc = yes; then
10704
10705 cat >>confdefs.h <<\_ACEOF
10706@@ -3774,9 +4578,9 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
10707 inttypes.h stdint.h unistd.h
10708 do
10709 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
10710-echo "$as_me:$LINENO: checking for $ac_header" >&5
10711-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
10712-if eval "test \"\${$as_ac_Header+set}\" = set"; then
10713+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
10714+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
10715+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
10716 echo $ECHO_N "(cached) $ECHO_C" >&6
10717 else
10718 cat >conftest.$ac_ext <<_ACEOF
10719@@ -3790,37 +4594,35 @@ $ac_includes_default
10720 #include <$ac_header>
10721 _ACEOF
10722 rm -f conftest.$ac_objext
10723-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10724- (eval $ac_compile) 2>conftest.er1
10725+if { (ac_try="$ac_compile"
10726+case "(($ac_try" in
10727+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10728+ *) ac_try_echo=$ac_try;;
10729+esac
10730+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10731+ (eval "$ac_compile") 2>conftest.er1
10732 ac_status=$?
10733 grep -v '^ *+' conftest.er1 >conftest.err
10734 rm -f conftest.er1
10735 cat conftest.err >&5
10736 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10737- (exit $ac_status); } &&
10738- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
10739- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10740- (eval $ac_try) 2>&5
10741- ac_status=$?
10742- echo "$as_me:$LINENO: \$? = $ac_status" >&5
10743- (exit $ac_status); }; } &&
10744- { ac_try='test -s conftest.$ac_objext'
10745- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10746- (eval $ac_try) 2>&5
10747- ac_status=$?
10748- echo "$as_me:$LINENO: \$? = $ac_status" >&5
10749- (exit $ac_status); }; }; then
10750+ (exit $ac_status); } && {
10751+ test -z "$ac_c_werror_flag" ||
10752+ test ! -s conftest.err
10753+ } && test -s conftest.$ac_objext; then
10754 eval "$as_ac_Header=yes"
10755 else
10756 echo "$as_me: failed program was:" >&5
10757 sed 's/^/| /' conftest.$ac_ext >&5
10758
10759-eval "$as_ac_Header=no"
10760+ eval "$as_ac_Header=no"
10761 fi
10762-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10763+
10764+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10765 fi
10766-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
10767-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
10768+ac_res=`eval echo '${'$as_ac_Header'}'`
10769+ { echo "$as_me:$LINENO: result: $ac_res" >&5
10770+echo "${ECHO_T}$ac_res" >&6; }
10771 if test `eval echo '${'$as_ac_Header'}'` = yes; then
10772 cat >>confdefs.h <<_ACEOF
10773 #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
10774@@ -3831,8 +4633,8 @@ fi
10775 done
10776
10777
10778-echo "$as_me:$LINENO: checking for history_init in -ledit" >&5
10779-echo $ECHO_N "checking for history_init in -ledit... $ECHO_C" >&6
10780+{ echo "$as_me:$LINENO: checking for history_init in -ledit" >&5
10781+echo $ECHO_N "checking for history_init in -ledit... $ECHO_C" >&6; }
10782 if test "${ac_cv_lib_edit_history_init+set}" = set; then
10783 echo $ECHO_N "(cached) $ECHO_C" >&6
10784 else
10785@@ -3845,69 +4647,67 @@ cat confdefs.h >>conftest.$ac_ext
10786 cat >>conftest.$ac_ext <<_ACEOF
10787 /* end confdefs.h. */
10788
10789-/* Override any gcc2 internal prototype to avoid an error. */
10790+/* Override any GCC internal prototype to avoid an error.
10791+ Use char because int might match the return type of a GCC
10792+ builtin and then its argument prototype would still apply. */
10793 #ifdef __cplusplus
10794 extern "C"
10795 #endif
10796-/* We use char because int might match the return type of a gcc2
10797- builtin and then its argument prototype would still apply. */
10798 char history_init ();
10799 int
10800 main ()
10801 {
10802-history_init ();
10803+return history_init ();
10804 ;
10805 return 0;
10806 }
10807 _ACEOF
10808 rm -f conftest.$ac_objext conftest$ac_exeext
10809-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
10810- (eval $ac_link) 2>conftest.er1
10811+if { (ac_try="$ac_link"
10812+case "(($ac_try" in
10813+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10814+ *) ac_try_echo=$ac_try;;
10815+esac
10816+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10817+ (eval "$ac_link") 2>conftest.er1
10818 ac_status=$?
10819 grep -v '^ *+' conftest.er1 >conftest.err
10820 rm -f conftest.er1
10821 cat conftest.err >&5
10822 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10823- (exit $ac_status); } &&
10824- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
10825- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10826- (eval $ac_try) 2>&5
10827- ac_status=$?
10828- echo "$as_me:$LINENO: \$? = $ac_status" >&5
10829- (exit $ac_status); }; } &&
10830- { ac_try='test -s conftest$ac_exeext'
10831- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10832- (eval $ac_try) 2>&5
10833- ac_status=$?
10834- echo "$as_me:$LINENO: \$? = $ac_status" >&5
10835- (exit $ac_status); }; }; then
10836+ (exit $ac_status); } && {
10837+ test -z "$ac_c_werror_flag" ||
10838+ test ! -s conftest.err
10839+ } && test -s conftest$ac_exeext &&
10840+ $as_test_x conftest$ac_exeext; then
10841 ac_cv_lib_edit_history_init=yes
10842 else
10843 echo "$as_me: failed program was:" >&5
10844 sed 's/^/| /' conftest.$ac_ext >&5
10845
10846-ac_cv_lib_edit_history_init=no
10847+ ac_cv_lib_edit_history_init=no
10848 fi
10849-rm -f conftest.err conftest.$ac_objext \
10850+
10851+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
10852 conftest$ac_exeext conftest.$ac_ext
10853 LIBS=$ac_check_lib_save_LIBS
10854 fi
10855-echo "$as_me:$LINENO: result: $ac_cv_lib_edit_history_init" >&5
10856-echo "${ECHO_T}$ac_cv_lib_edit_history_init" >&6
10857+{ echo "$as_me:$LINENO: result: $ac_cv_lib_edit_history_init" >&5
10858+echo "${ECHO_T}$ac_cv_lib_edit_history_init" >&6; }
10859 if test $ac_cv_lib_edit_history_init = yes; then
10860
10861 if test "${ac_cv_header_histedit_h+set}" = set; then
10862- echo "$as_me:$LINENO: checking for histedit.h" >&5
10863-echo $ECHO_N "checking for histedit.h... $ECHO_C" >&6
10864+ { echo "$as_me:$LINENO: checking for histedit.h" >&5
10865+echo $ECHO_N "checking for histedit.h... $ECHO_C" >&6; }
10866 if test "${ac_cv_header_histedit_h+set}" = set; then
10867 echo $ECHO_N "(cached) $ECHO_C" >&6
10868 fi
10869-echo "$as_me:$LINENO: result: $ac_cv_header_histedit_h" >&5
10870-echo "${ECHO_T}$ac_cv_header_histedit_h" >&6
10871+{ echo "$as_me:$LINENO: result: $ac_cv_header_histedit_h" >&5
10872+echo "${ECHO_T}$ac_cv_header_histedit_h" >&6; }
10873 else
10874 # Is the header compilable?
10875-echo "$as_me:$LINENO: checking histedit.h usability" >&5
10876-echo $ECHO_N "checking histedit.h usability... $ECHO_C" >&6
10877+{ echo "$as_me:$LINENO: checking histedit.h usability" >&5
10878+echo $ECHO_N "checking histedit.h usability... $ECHO_C" >&6; }
10879 cat >conftest.$ac_ext <<_ACEOF
10880 /* confdefs.h. */
10881 _ACEOF
10882@@ -3918,40 +4718,37 @@ $ac_includes_default
10883 #include <histedit.h>
10884 _ACEOF
10885 rm -f conftest.$ac_objext
10886-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
10887- (eval $ac_compile) 2>conftest.er1
10888+if { (ac_try="$ac_compile"
10889+case "(($ac_try" in
10890+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10891+ *) ac_try_echo=$ac_try;;
10892+esac
10893+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10894+ (eval "$ac_compile") 2>conftest.er1
10895 ac_status=$?
10896 grep -v '^ *+' conftest.er1 >conftest.err
10897 rm -f conftest.er1
10898 cat conftest.err >&5
10899 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10900- (exit $ac_status); } &&
10901- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err'
10902- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10903- (eval $ac_try) 2>&5
10904- ac_status=$?
10905- echo "$as_me:$LINENO: \$? = $ac_status" >&5
10906- (exit $ac_status); }; } &&
10907- { ac_try='test -s conftest.$ac_objext'
10908- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
10909- (eval $ac_try) 2>&5
10910- ac_status=$?
10911- echo "$as_me:$LINENO: \$? = $ac_status" >&5
10912- (exit $ac_status); }; }; then
10913+ (exit $ac_status); } && {
10914+ test -z "$ac_c_werror_flag" ||
10915+ test ! -s conftest.err
10916+ } && test -s conftest.$ac_objext; then
10917 ac_header_compiler=yes
10918 else
10919 echo "$as_me: failed program was:" >&5
10920 sed 's/^/| /' conftest.$ac_ext >&5
10921
10922-ac_header_compiler=no
10923+ ac_header_compiler=no
10924 fi
10925-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
10926-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
10927-echo "${ECHO_T}$ac_header_compiler" >&6
10928+
10929+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
10930+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
10931+echo "${ECHO_T}$ac_header_compiler" >&6; }
10932
10933 # Is the header present?
10934-echo "$as_me:$LINENO: checking histedit.h presence" >&5
10935-echo $ECHO_N "checking histedit.h presence... $ECHO_C" >&6
10936+{ echo "$as_me:$LINENO: checking histedit.h presence" >&5
10937+echo $ECHO_N "checking histedit.h presence... $ECHO_C" >&6; }
10938 cat >conftest.$ac_ext <<_ACEOF
10939 /* confdefs.h. */
10940 _ACEOF
10941@@ -3960,24 +4757,22 @@ cat >>conftest.$ac_ext <<_ACEOF
10942 /* end confdefs.h. */
10943 #include <histedit.h>
10944 _ACEOF
10945-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
10946- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
10947+if { (ac_try="$ac_cpp conftest.$ac_ext"
10948+case "(($ac_try" in
10949+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
10950+ *) ac_try_echo=$ac_try;;
10951+esac
10952+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
10953+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
10954 ac_status=$?
10955 grep -v '^ *+' conftest.er1 >conftest.err
10956 rm -f conftest.er1
10957 cat conftest.err >&5
10958 echo "$as_me:$LINENO: \$? = $ac_status" >&5
10959- (exit $ac_status); } >/dev/null; then
10960- if test -s conftest.err; then
10961- ac_cpp_err=$ac_c_preproc_warn_flag
10962- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
10963- else
10964- ac_cpp_err=
10965- fi
10966-else
10967- ac_cpp_err=yes
10968-fi
10969-if test -z "$ac_cpp_err"; then
10970+ (exit $ac_status); } >/dev/null && {
10971+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
10972+ test ! -s conftest.err
10973+ }; then
10974 ac_header_preproc=yes
10975 else
10976 echo "$as_me: failed program was:" >&5
10977@@ -3985,9 +4780,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
10978
10979 ac_header_preproc=no
10980 fi
10981+
10982 rm -f conftest.err conftest.$ac_ext
10983-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
10984-echo "${ECHO_T}$ac_header_preproc" >&6
10985+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
10986+echo "${ECHO_T}$ac_header_preproc" >&6; }
10987
10988 # So? What about this header?
10989 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
10990@@ -4011,25 +4807,18 @@ echo "$as_me: WARNING: histedit.h: section \"Present But Cannot Be Compiled\
10991 echo "$as_me: WARNING: histedit.h: proceeding with the preprocessor's result" >&2;}
10992 { echo "$as_me:$LINENO: WARNING: histedit.h: in the future, the compiler will take precedence" >&5
10993 echo "$as_me: WARNING: histedit.h: in the future, the compiler will take precedence" >&2;}
10994- (
10995- cat <<\_ASBOX
10996-## ------------------------------- ##
10997-## Report this to the dash lists. ##
10998-## ------------------------------- ##
10999-_ASBOX
11000- ) |
11001- sed "s/^/$as_me: WARNING: /" >&2
11002+
11003 ;;
11004 esac
11005-echo "$as_me:$LINENO: checking for histedit.h" >&5
11006-echo $ECHO_N "checking for histedit.h... $ECHO_C" >&6
11007+{ echo "$as_me:$LINENO: checking for histedit.h" >&5
11008+echo $ECHO_N "checking for histedit.h... $ECHO_C" >&6; }
11009 if test "${ac_cv_header_histedit_h+set}" = set; then
11010 echo $ECHO_N "(cached) $ECHO_C" >&6
11011 else
11012 ac_cv_header_histedit_h=$ac_header_preproc
11013 fi
11014-echo "$as_me:$LINENO: result: $ac_cv_header_histedit_h" >&5
11015-echo "${ECHO_T}$ac_cv_header_histedit_h" >&6
11016+{ echo "$as_me:$LINENO: result: $ac_cv_header_histedit_h" >&5
11017+echo "${ECHO_T}$ac_cv_header_histedit_h" >&6; }
11018
11019 fi
11020 if test $ac_cv_header_histedit_h = yes; then
11021@@ -4053,7 +4842,7 @@ _ACEOF
11022 else
11023 export LIBS="$LIBS -ledit"
11024 fi
11025- ac_config_files="$ac_config_files Makefile src/Makefile"
11026+ac_config_files="$ac_config_files Makefile src/Makefile"
11027
11028 cat >confcache <<\_ACEOF
11029 # This file is a shell script that caches the results of configure
11030@@ -4073,39 +4862,58 @@ _ACEOF
11031
11032 # The following way of writing the cache mishandles newlines in values,
11033 # but we know of no workaround that is simple, portable, and efficient.
11034-# So, don't put newlines in cache variables' values.
11035+# So, we kill variables containing newlines.
11036 # Ultrix sh set writes to stderr and can't be redirected directly,
11037 # and sets the high bit in the cache file unless we assign to the vars.
11038-{
11039+(
11040+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
11041+ eval ac_val=\$$ac_var
11042+ case $ac_val in #(
11043+ *${as_nl}*)
11044+ case $ac_var in #(
11045+ *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
11046+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
11047+ esac
11048+ case $ac_var in #(
11049+ _ | IFS | as_nl) ;; #(
11050+ *) $as_unset $ac_var ;;
11051+ esac ;;
11052+ esac
11053+ done
11054+
11055 (set) 2>&1 |
11056- case `(ac_space=' '; set | grep ac_space) 2>&1` in
11057- *ac_space=\ *)
11058+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
11059+ *${as_nl}ac_space=\ *)
11060 # `set' does not quote correctly, so add quotes (double-quote
11061 # substitution turns \\\\ into \\, and sed turns \\ into \).
11062 sed -n \
11063 "s/'/'\\\\''/g;
11064 s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
11065- ;;
11066+ ;; #(
11067 *)
11068 # `set' quotes correctly as required by POSIX, so do not add quotes.
11069- sed -n \
11070- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
11071+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
11072 ;;
11073- esac;
11074-} |
11075+ esac |
11076+ sort
11077+) |
11078 sed '
11079+ /^ac_cv_env_/b end
11080 t clear
11081- : clear
11082+ :clear
11083 s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
11084 t end
11085- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
11086- : end' >>confcache
11087-if diff $cache_file confcache >/dev/null 2>&1; then :; else
11088- if test -w $cache_file; then
11089- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
11090+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
11091+ :end' >>confcache
11092+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
11093+ if test -w "$cache_file"; then
11094+ test "x$cache_file" != "x/dev/null" &&
11095+ { echo "$as_me:$LINENO: updating cache $cache_file" >&5
11096+echo "$as_me: updating cache $cache_file" >&6;}
11097 cat confcache >$cache_file
11098 else
11099- echo "not updating unwritable cache $cache_file"
11100+ { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
11101+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
11102 fi
11103 fi
11104 rm -f confcache
11105@@ -4114,32 +4922,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix
11106 # Let make expand exec_prefix.
11107 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
11108
11109-# VPATH may cause trouble with some makes, so we remove $(srcdir),
11110-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
11111-# trailing colons and then remove the whole line if VPATH becomes empty
11112-# (actually we leave an empty line to preserve line numbers).
11113-if test "x$srcdir" = x.; then
11114- ac_vpsub='/^[ ]*VPATH[ ]*=/{
11115-s/:*\$(srcdir):*/:/;
11116-s/:*\${srcdir}:*/:/;
11117-s/:*@srcdir@:*/:/;
11118-s/^\([^=]*=[ ]*\):*/\1/;
11119-s/:*$//;
11120-s/^[^=]*=[ ]*$//;
11121-}'
11122-fi
11123-
11124 DEFS=-DHAVE_CONFIG_H
11125
11126 ac_libobjs=
11127 ac_ltlibobjs=
11128 for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
11129 # 1. Remove the extension, and $U if already installed.
11130- ac_i=`echo "$ac_i" |
11131- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
11132- # 2. Add them.
11133- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
11134- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
11135+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
11136+ ac_i=`echo "$ac_i" | sed "$ac_script"`
11137+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
11138+ # will be set to the directory where LIBOBJS objects are built.
11139+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
11140+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
11141 done
11142 LIBOBJS=$ac_libobjs
11143
11144@@ -4184,17 +4978,45 @@ cat >>$CONFIG_STATUS <<\_ACEOF
11145 ## M4sh Initialization. ##
11146 ## --------------------- ##
11147
11148-# Be Bourne compatible
11149+# Be more Bourne compatible
11150+DUALCASE=1; export DUALCASE # for MKS sh
11151 if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
11152 emulate sh
11153 NULLCMD=:
11154 # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
11155 # is contrary to our usage. Disable this feature.
11156 alias -g '${1+"$@"}'='"$@"'
11157-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
11158- set -o posix
11159+ setopt NO_GLOB_SUBST
11160+else
11161+ case `(set -o) 2>/dev/null` in
11162+ *posix*) set -o posix ;;
11163+esac
11164+
11165+fi
11166+
11167+
11168+
11169+
11170+# PATH needs CR
11171+# Avoid depending upon Character Ranges.
11172+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
11173+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
11174+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
11175+as_cr_digits='0123456789'
11176+as_cr_alnum=$as_cr_Letters$as_cr_digits
11177+
11178+# The user is always right.
11179+if test "${PATH_SEPARATOR+set}" != set; then
11180+ echo "#! /bin/sh" >conf$$.sh
11181+ echo "exit 0" >>conf$$.sh
11182+ chmod +x conf$$.sh
11183+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
11184+ PATH_SEPARATOR=';'
11185+ else
11186+ PATH_SEPARATOR=:
11187+ fi
11188+ rm -f conf$$.sh
11189 fi
11190-DUALCASE=1; export DUALCASE # for MKS sh
11191
11192 # Support unset when possible.
11193 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
11194@@ -4204,8 +5026,43 @@ else
11195 fi
11196
11197
11198+# IFS
11199+# We need space, tab and new line, in precisely that order. Quoting is
11200+# there to prevent editors from complaining about space-tab.
11201+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
11202+# splitting by setting IFS to empty value.)
11203+as_nl='
11204+'
11205+IFS=" "" $as_nl"
11206+
11207+# Find who we are. Look in the path if we contain no directory separator.
11208+case $0 in
11209+ *[\\/]* ) as_myself=$0 ;;
11210+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11211+for as_dir in $PATH
11212+do
11213+ IFS=$as_save_IFS
11214+ test -z "$as_dir" && as_dir=.
11215+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
11216+done
11217+IFS=$as_save_IFS
11218+
11219+ ;;
11220+esac
11221+# We did not find ourselves, most probably we were run as `sh COMMAND'
11222+# in which case we are not to be found in the path.
11223+if test "x$as_myself" = x; then
11224+ as_myself=$0
11225+fi
11226+if test ! -f "$as_myself"; then
11227+ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
11228+ { (exit 1); exit 1; }
11229+fi
11230+
11231 # Work around bugs in pre-3.0 UWIN ksh.
11232-$as_unset ENV MAIL MAILPATH
11233+for as_var in ENV MAIL MAILPATH
11234+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
11235+done
11236 PS1='$ '
11237 PS2='> '
11238 PS4='+ '
11239@@ -4219,18 +5076,19 @@ do
11240 if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
11241 eval $as_var=C; export $as_var
11242 else
11243- $as_unset $as_var
11244+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
11245 fi
11246 done
11247
11248 # Required to use basename.
11249-if expr a : '\(a\)' >/dev/null 2>&1; then
11250+if expr a : '\(a\)' >/dev/null 2>&1 &&
11251+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
11252 as_expr=expr
11253 else
11254 as_expr=false
11255 fi
11256
11257-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
11258+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
11259 as_basename=basename
11260 else
11261 as_basename=false
11262@@ -4238,159 +5096,120 @@ fi
11263
11264
11265 # Name of the executable.
11266-as_me=`$as_basename "$0" ||
11267+as_me=`$as_basename -- "$0" ||
11268 $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
11269 X"$0" : 'X\(//\)$' \| \
11270- X"$0" : 'X\(/\)$' \| \
11271- . : '\(.\)' 2>/dev/null ||
11272+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
11273 echo X/"$0" |
11274- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
11275- /^X\/\(\/\/\)$/{ s//\1/; q; }
11276- /^X\/\(\/\).*/{ s//\1/; q; }
11277- s/.*/./; q'`
11278-
11279-
11280-# PATH needs CR, and LINENO needs CR and PATH.
11281-# Avoid depending upon Character Ranges.
11282-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
11283-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
11284-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
11285-as_cr_digits='0123456789'
11286-as_cr_alnum=$as_cr_Letters$as_cr_digits
11287+ sed '/^.*\/\([^/][^/]*\)\/*$/{
11288+ s//\1/
11289+ q
11290+ }
11291+ /^X\/\(\/\/\)$/{
11292+ s//\1/
11293+ q
11294+ }
11295+ /^X\/\(\/\).*/{
11296+ s//\1/
11297+ q
11298+ }
11299+ s/.*/./; q'`
11300
11301-# The user is always right.
11302-if test "${PATH_SEPARATOR+set}" != set; then
11303- echo "#! /bin/sh" >conf$$.sh
11304- echo "exit 0" >>conf$$.sh
11305- chmod +x conf$$.sh
11306- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
11307- PATH_SEPARATOR=';'
11308- else
11309- PATH_SEPARATOR=:
11310- fi
11311- rm -f conf$$.sh
11312-fi
11313+# CDPATH.
11314+$as_unset CDPATH
11315
11316
11317- as_lineno_1=$LINENO
11318- as_lineno_2=$LINENO
11319- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
11320- test "x$as_lineno_1" != "x$as_lineno_2" &&
11321- test "x$as_lineno_3" = "x$as_lineno_2" || {
11322- # Find who we are. Look in the path if we contain no path at all
11323- # relative or not.
11324- case $0 in
11325- *[\\/]* ) as_myself=$0 ;;
11326- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11327-for as_dir in $PATH
11328-do
11329- IFS=$as_save_IFS
11330- test -z "$as_dir" && as_dir=.
11331- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
11332-done
11333
11334- ;;
11335- esac
11336- # We did not find ourselves, most probably we were run as `sh COMMAND'
11337- # in which case we are not to be found in the path.
11338- if test "x$as_myself" = x; then
11339- as_myself=$0
11340- fi
11341- if test ! -f "$as_myself"; then
11342- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
11343-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
11344- { (exit 1); exit 1; }; }
11345- fi
11346- case $CONFIG_SHELL in
11347- '')
11348- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
11349-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
11350-do
11351- IFS=$as_save_IFS
11352- test -z "$as_dir" && as_dir=.
11353- for as_base in sh bash ksh sh5; do
11354- case $as_dir in
11355- /*)
11356- if ("$as_dir/$as_base" -c '
11357 as_lineno_1=$LINENO
11358 as_lineno_2=$LINENO
11359- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
11360 test "x$as_lineno_1" != "x$as_lineno_2" &&
11361- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
11362- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
11363- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
11364- CONFIG_SHELL=$as_dir/$as_base
11365- export CONFIG_SHELL
11366- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
11367- fi;;
11368- esac
11369- done
11370-done
11371-;;
11372- esac
11373+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
11374
11375 # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
11376 # uniformly replaced by the line number. The first 'sed' inserts a
11377- # line-number line before each line; the second 'sed' does the real
11378- # work. The second script uses 'N' to pair each line-number line
11379- # with the numbered line, and appends trailing '-' during
11380- # substitution so that $LINENO is not a special case at line end.
11381+ # line-number line after each line using $LINENO; the second 'sed'
11382+ # does the real work. The second script uses 'N' to pair each
11383+ # line-number line with the line containing $LINENO, and appends
11384+ # trailing '-' during substitution so that $LINENO is not a special
11385+ # case at line end.
11386 # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
11387- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
11388- sed '=' <$as_myself |
11389+ # scripts with optimization help from Paolo Bonzini. Blame Lee
11390+ # E. McMahon (1931-1989) for sed's syntax. :-)
11391+ sed -n '
11392+ p
11393+ /[$]LINENO/=
11394+ ' <$as_myself |
11395 sed '
11396+ s/[$]LINENO.*/&-/
11397+ t lineno
11398+ b
11399+ :lineno
11400 N
11401- s,$,-,
11402- : loop
11403- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
11404+ :loop
11405+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
11406 t loop
11407- s,-$,,
11408- s,^['$as_cr_digits']*\n,,
11409+ s/-\n.*//
11410 ' >$as_me.lineno &&
11411- chmod +x $as_me.lineno ||
11412- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
11413-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
11414+ chmod +x "$as_me.lineno" ||
11415+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
11416 { (exit 1); exit 1; }; }
11417
11418 # Don't try to exec as it changes $[0], causing all sort of problems
11419 # (the dirname of $[0] is not the place where we might find the
11420- # original and so on. Autoconf is especially sensible to this).
11421- . ./$as_me.lineno
11422+ # original and so on. Autoconf is especially sensitive to this).
11423+ . "./$as_me.lineno"
11424 # Exit status is that of the last command.
11425 exit
11426 }
11427
11428
11429-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
11430- *c*,-n*) ECHO_N= ECHO_C='
11431-' ECHO_T=' ' ;;
11432- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
11433- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
11434+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
11435+ as_dirname=dirname
11436+else
11437+ as_dirname=false
11438+fi
11439+
11440+ECHO_C= ECHO_N= ECHO_T=
11441+case `echo -n x` in
11442+-n*)
11443+ case `echo 'x\c'` in
11444+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
11445+ *) ECHO_C='\c';;
11446+ esac;;
11447+*)
11448+ ECHO_N='-n';;
11449 esac
11450
11451-if expr a : '\(a\)' >/dev/null 2>&1; then
11452+if expr a : '\(a\)' >/dev/null 2>&1 &&
11453+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
11454 as_expr=expr
11455 else
11456 as_expr=false
11457 fi
11458
11459 rm -f conf$$ conf$$.exe conf$$.file
11460+if test -d conf$$.dir; then
11461+ rm -f conf$$.dir/conf$$.file
11462+else
11463+ rm -f conf$$.dir
11464+ mkdir conf$$.dir
11465+fi
11466 echo >conf$$.file
11467 if ln -s conf$$.file conf$$ 2>/dev/null; then
11468- # We could just check for DJGPP; but this test a) works b) is more generic
11469- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
11470- if test -f conf$$.exe; then
11471- # Don't use ln at all; we don't have any links
11472+ as_ln_s='ln -s'
11473+ # ... but there are two gotchas:
11474+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
11475+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
11476+ # In both cases, we have to default to `cp -p'.
11477+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
11478 as_ln_s='cp -p'
11479- else
11480- as_ln_s='ln -s'
11481- fi
11482 elif ln conf$$.file conf$$ 2>/dev/null; then
11483 as_ln_s=ln
11484 else
11485 as_ln_s='cp -p'
11486 fi
11487-rm -f conf$$ conf$$.exe conf$$.file
11488+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
11489+rmdir conf$$.dir 2>/dev/null
11490
11491 if mkdir -p . 2>/dev/null; then
11492 as_mkdir_p=:
11493@@ -4399,7 +5218,28 @@ else
11494 as_mkdir_p=false
11495 fi
11496
11497-as_executable_p="test -f"
11498+if test -x / >/dev/null 2>&1; then
11499+ as_test_x='test -x'
11500+else
11501+ if ls -dL / >/dev/null 2>&1; then
11502+ as_ls_L_option=L
11503+ else
11504+ as_ls_L_option=
11505+ fi
11506+ as_test_x='
11507+ eval sh -c '\''
11508+ if test -d "$1"; then
11509+ test -d "$1/.";
11510+ else
11511+ case $1 in
11512+ -*)set "./$1";;
11513+ esac;
11514+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
11515+ ???[sx]*):;;*)false;;esac;fi
11516+ '\'' sh
11517+ '
11518+fi
11519+as_executable_p=$as_test_x
11520
11521 # Sed expression to map a string onto a valid CPP name.
11522 as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
11523@@ -4408,31 +5248,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
11524 as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
11525
11526
11527-# IFS
11528-# We need space, tab and new line, in precisely that order.
11529-as_nl='
11530-'
11531-IFS=" $as_nl"
11532-
11533-# CDPATH.
11534-$as_unset CDPATH
11535-
11536 exec 6>&1
11537
11538-# Open the log real soon, to keep \$[0] and so on meaningful, and to
11539+# Save the log message, to keep $[0] and so on meaningful, and to
11540 # report actual input values of CONFIG_FILES etc. instead of their
11541-# values after options handling. Logging --version etc. is OK.
11542-exec 5>>config.log
11543-{
11544- echo
11545- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
11546-## Running $as_me. ##
11547-_ASBOX
11548-} >&5
11549-cat >&5 <<_CSEOF
11550-
11551+# values after options handling.
11552+ac_log="
11553 This file was extended by dash $as_me 0.5.4, which was
11554-generated by GNU Autoconf 2.59. Invocation command line was
11555+generated by GNU Autoconf 2.61. Invocation command line was
11556
11557 CONFIG_FILES = $CONFIG_FILES
11558 CONFIG_HEADERS = $CONFIG_HEADERS
11559@@ -4440,30 +5263,20 @@ generated by GNU Autoconf 2.59. Invocation command line was
11560 CONFIG_COMMANDS = $CONFIG_COMMANDS
11561 $ $0 $@
11562
11563-_CSEOF
11564-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
11565-echo >&5
11566+on `(hostname || uname -n) 2>/dev/null | sed 1q`
11567+"
11568+
11569 _ACEOF
11570
11571+cat >>$CONFIG_STATUS <<_ACEOF
11572 # Files that config.status was made for.
11573-if test -n "$ac_config_files"; then
11574- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
11575-fi
11576-
11577-if test -n "$ac_config_headers"; then
11578- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
11579-fi
11580-
11581-if test -n "$ac_config_links"; then
11582- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
11583-fi
11584+config_files="$ac_config_files"
11585+config_headers="$ac_config_headers"
11586+config_commands="$ac_config_commands"
11587
11588-if test -n "$ac_config_commands"; then
11589- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
11590-fi
11591+_ACEOF
11592
11593 cat >>$CONFIG_STATUS <<\_ACEOF
11594-
11595 ac_cs_usage="\
11596 \`$as_me' instantiates files from templates according to the
11597 current configuration.
11598@@ -4471,7 +5284,7 @@ current configuration.
11599 Usage: $0 [OPTIONS] [FILE]...
11600
11601 -h, --help print this help, then exit
11602- -V, --version print version number, then exit
11603+ -V, --version print version number and configuration settings, then exit
11604 -q, --quiet do not print progress messages
11605 -d, --debug don't remove temporary files
11606 --recheck update $as_me by reconfiguring in the same conditions
11607@@ -4490,19 +5303,22 @@ Configuration commands:
11608 $config_commands
11609
11610 Report bugs to <bug-autoconf@gnu.org>."
11611-_ACEOF
11612
11613+_ACEOF
11614 cat >>$CONFIG_STATUS <<_ACEOF
11615 ac_cs_version="\\
11616 dash config.status 0.5.4
11617-configured by $0, generated by GNU Autoconf 2.59,
11618- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
11619+configured by $0, generated by GNU Autoconf 2.61,
11620+ with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
11621
11622-Copyright (C) 2003 Free Software Foundation, Inc.
11623+Copyright (C) 2006 Free Software Foundation, Inc.
11624 This config.status script is free software; the Free Software Foundation
11625 gives unlimited permission to copy, distribute and modify it."
11626-srcdir=$srcdir
11627-INSTALL="$INSTALL"
11628+
11629+ac_pwd='$ac_pwd'
11630+srcdir='$srcdir'
11631+INSTALL='$INSTALL'
11632+MKDIR_P='$MKDIR_P'
11633 _ACEOF
11634
11635 cat >>$CONFIG_STATUS <<\_ACEOF
11636@@ -4513,39 +5329,24 @@ while test $# != 0
11637 do
11638 case $1 in
11639 --*=*)
11640- ac_option=`expr "x$1" : 'x\([^=]*\)='`
11641- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
11642+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
11643+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
11644 ac_shift=:
11645 ;;
11646- -*)
11647+ *)
11648 ac_option=$1
11649 ac_optarg=$2
11650 ac_shift=shift
11651 ;;
11652- *) # This is not an option, so the user has probably given explicit
11653- # arguments.
11654- ac_option=$1
11655- ac_need_defaults=false;;
11656 esac
11657
11658 case $ac_option in
11659 # Handling of the options.
11660-_ACEOF
11661-cat >>$CONFIG_STATUS <<\_ACEOF
11662 -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
11663 ac_cs_recheck=: ;;
11664- --version | --vers* | -V )
11665- echo "$ac_cs_version"; exit 0 ;;
11666- --he | --h)
11667- # Conflict between --help and --header
11668- { { echo "$as_me:$LINENO: error: ambiguous option: $1
11669-Try \`$0 --help' for more information." >&5
11670-echo "$as_me: error: ambiguous option: $1
11671-Try \`$0 --help' for more information." >&2;}
11672- { (exit 1); exit 1; }; };;
11673- --help | --hel | -h )
11674- echo "$ac_cs_usage"; exit 0 ;;
11675- --debug | --d* | -d )
11676+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
11677+ echo "$ac_cs_version"; exit ;;
11678+ --debug | --debu | --deb | --de | --d | -d )
11679 debug=: ;;
11680 --file | --fil | --fi | --f )
11681 $ac_shift
11682@@ -4555,18 +5356,24 @@ Try \`$0 --help' for more information." >&2;}
11683 $ac_shift
11684 CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
11685 ac_need_defaults=false;;
11686+ --he | --h)
11687+ # Conflict between --help and --header
11688+ { echo "$as_me: error: ambiguous option: $1
11689+Try \`$0 --help' for more information." >&2
11690+ { (exit 1); exit 1; }; };;
11691+ --help | --hel | -h )
11692+ echo "$ac_cs_usage"; exit ;;
11693 -q | -quiet | --quiet | --quie | --qui | --qu | --q \
11694 | -silent | --silent | --silen | --sile | --sil | --si | --s)
11695 ac_cs_silent=: ;;
11696
11697 # This is an error.
11698- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
11699-Try \`$0 --help' for more information." >&5
11700-echo "$as_me: error: unrecognized option: $1
11701-Try \`$0 --help' for more information." >&2;}
11702+ -*) { echo "$as_me: error: unrecognized option: $1
11703+Try \`$0 --help' for more information." >&2
11704 { (exit 1); exit 1; }; } ;;
11705
11706- *) ac_config_targets="$ac_config_targets $1" ;;
11707+ *) ac_config_targets="$ac_config_targets $1"
11708+ ac_need_defaults=false ;;
11709
11710 esac
11711 shift
11712@@ -4582,38 +5389,50 @@ fi
11713 _ACEOF
11714 cat >>$CONFIG_STATUS <<_ACEOF
11715 if \$ac_cs_recheck; then
11716- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
11717- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
11718+ echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
11719+ CONFIG_SHELL=$SHELL
11720+ export CONFIG_SHELL
11721+ exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
11722 fi
11723
11724 _ACEOF
11725+cat >>$CONFIG_STATUS <<\_ACEOF
11726+exec 5>>config.log
11727+{
11728+ echo
11729+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
11730+## Running $as_me. ##
11731+_ASBOX
11732+ echo "$ac_log"
11733+} >&5
11734
11735+_ACEOF
11736 cat >>$CONFIG_STATUS <<_ACEOF
11737 #
11738-# INIT-COMMANDS section.
11739+# INIT-COMMANDS
11740 #
11741-
11742 AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
11743
11744 _ACEOF
11745
11746-
11747-
11748 cat >>$CONFIG_STATUS <<\_ACEOF
11749+
11750+# Handling of arguments.
11751 for ac_config_target in $ac_config_targets
11752 do
11753- case "$ac_config_target" in
11754- # Handling of arguments.
11755- "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
11756- "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
11757- "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
11758- "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
11759+ case $ac_config_target in
11760+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
11761+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
11762+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
11763+ "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
11764+
11765 *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
11766 echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
11767 { (exit 1); exit 1; }; };;
11768 esac
11769 done
11770
11771+
11772 # If the user did not use the arguments to specify the items to instantiate,
11773 # then the envvar interface is used. Set only those that are not.
11774 # We use the long form for the default assignment because of an extremely
11775@@ -4625,578 +5444,534 @@ if $ac_need_defaults; then
11776 fi
11777
11778 # Have a temporary directory for convenience. Make it in the build tree
11779-# simply because there is no reason to put it here, and in addition,
11780+# simply because there is no reason against having it here, and in addition,
11781 # creating and moving files from /tmp can sometimes cause problems.
11782-# Create a temporary directory, and hook for its removal unless debugging.
11783+# Hook for its removal unless debugging.
11784+# Note that there is a small window in which the directory will not be cleaned:
11785+# after its creation but before its name has been assigned to `$tmp'.
11786 $debug ||
11787 {
11788- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
11789+ tmp=
11790+ trap 'exit_status=$?
11791+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
11792+' 0
11793 trap '{ (exit 1); exit 1; }' 1 2 13 15
11794 }
11795-
11796 # Create a (secure) tmp directory for tmp files.
11797
11798 {
11799- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
11800+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
11801 test -n "$tmp" && test -d "$tmp"
11802 } ||
11803 {
11804- tmp=./confstat$$-$RANDOM
11805- (umask 077 && mkdir $tmp)
11806+ tmp=./conf$$-$RANDOM
11807+ (umask 077 && mkdir "$tmp")
11808 } ||
11809 {
11810 echo "$me: cannot create a temporary directory in ." >&2
11811 { (exit 1); exit 1; }
11812 }
11813
11814-_ACEOF
11815-
11816-cat >>$CONFIG_STATUS <<_ACEOF
11817-
11818 #
11819-# CONFIG_FILES section.
11820+# Set up the sed scripts for CONFIG_FILES section.
11821 #
11822
11823 # No need to generate the scripts if there are no CONFIG_FILES.
11824 # This happens for instance when ./config.status config.h
11825-if test -n "\$CONFIG_FILES"; then
11826- # Protect against being on the right side of a sed subst in config.status.
11827- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
11828- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
11829-s,@SHELL@,$SHELL,;t t
11830-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
11831-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
11832-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
11833-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
11834-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
11835-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
11836-s,@exec_prefix@,$exec_prefix,;t t
11837-s,@prefix@,$prefix,;t t
11838-s,@program_transform_name@,$program_transform_name,;t t
11839-s,@bindir@,$bindir,;t t
11840-s,@sbindir@,$sbindir,;t t
11841-s,@libexecdir@,$libexecdir,;t t
11842-s,@datadir@,$datadir,;t t
11843-s,@sysconfdir@,$sysconfdir,;t t
11844-s,@sharedstatedir@,$sharedstatedir,;t t
11845-s,@localstatedir@,$localstatedir,;t t
11846-s,@libdir@,$libdir,;t t
11847-s,@includedir@,$includedir,;t t
11848-s,@oldincludedir@,$oldincludedir,;t t
11849-s,@infodir@,$infodir,;t t
11850-s,@mandir@,$mandir,;t t
11851-s,@build_alias@,$build_alias,;t t
11852-s,@host_alias@,$host_alias,;t t
11853-s,@target_alias@,$target_alias,;t t
11854-s,@DEFS@,$DEFS,;t t
11855-s,@ECHO_C@,$ECHO_C,;t t
11856-s,@ECHO_N@,$ECHO_N,;t t
11857-s,@ECHO_T@,$ECHO_T,;t t
11858-s,@LIBS@,$LIBS,;t t
11859-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
11860-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
11861-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
11862-s,@CYGPATH_W@,$CYGPATH_W,;t t
11863-s,@PACKAGE@,$PACKAGE,;t t
11864-s,@VERSION@,$VERSION,;t t
11865-s,@ACLOCAL@,$ACLOCAL,;t t
11866-s,@AUTOCONF@,$AUTOCONF,;t t
11867-s,@AUTOMAKE@,$AUTOMAKE,;t t
11868-s,@AUTOHEADER@,$AUTOHEADER,;t t
11869-s,@MAKEINFO@,$MAKEINFO,;t t
11870-s,@install_sh@,$install_sh,;t t
11871-s,@STRIP@,$STRIP,;t t
11872-s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
11873-s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
11874-s,@mkdir_p@,$mkdir_p,;t t
11875-s,@AWK@,$AWK,;t t
11876-s,@SET_MAKE@,$SET_MAKE,;t t
11877-s,@am__leading_dot@,$am__leading_dot,;t t
11878-s,@AMTAR@,$AMTAR,;t t
11879-s,@am__tar@,$am__tar,;t t
11880-s,@am__untar@,$am__untar,;t t
11881-s,@CC@,$CC,;t t
11882-s,@CFLAGS@,$CFLAGS,;t t
11883-s,@LDFLAGS@,$LDFLAGS,;t t
11884-s,@CPPFLAGS@,$CPPFLAGS,;t t
11885-s,@ac_ct_CC@,$ac_ct_CC,;t t
11886-s,@EXEEXT@,$EXEEXT,;t t
11887-s,@OBJEXT@,$OBJEXT,;t t
11888-s,@DEPDIR@,$DEPDIR,;t t
11889-s,@am__include@,$am__include,;t t
11890-s,@am__quote@,$am__quote,;t t
11891-s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
11892-s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
11893-s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
11894-s,@CCDEPMODE@,$CCDEPMODE,;t t
11895-s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
11896-s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
11897-s,@YACC@,$YACC,;t t
11898-s,@CC_FOR_BUILD@,$CC_FOR_BUILD,;t t
11899-s,@CPP@,$CPP,;t t
11900-s,@EGREP@,$EGREP,;t t
11901-s,@LIBOBJS@,$LIBOBJS,;t t
11902-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
11903-CEOF
11904+if test -n "$CONFIG_FILES"; then
11905
11906 _ACEOF
11907
11908- cat >>$CONFIG_STATUS <<\_ACEOF
11909- # Split the substitutions into bite-sized pieces for seds with
11910- # small command number limits, like on Digital OSF/1 and HP-UX.
11911- ac_max_sed_lines=48
11912- ac_sed_frag=1 # Number of current file.
11913- ac_beg=1 # First line for current file.
11914- ac_end=$ac_max_sed_lines # Line after last line for current file.
11915- ac_more_lines=:
11916- ac_sed_cmds=
11917- while $ac_more_lines; do
11918- if test $ac_beg -gt 1; then
11919- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
11920- else
11921- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
11922- fi
11923- if test ! -s $tmp/subs.frag; then
11924- ac_more_lines=false
11925- else
11926- # The purpose of the label and of the branching condition is to
11927- # speed up the sed processing (if there are no `@' at all, there
11928- # is no need to browse any of the substitutions).
11929- # These are the two extra sed commands mentioned above.
11930- (echo ':t
11931- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
11932- if test -z "$ac_sed_cmds"; then
11933- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
11934- else
11935- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
11936- fi
11937- ac_sed_frag=`expr $ac_sed_frag + 1`
11938- ac_beg=$ac_end
11939- ac_end=`expr $ac_end + $ac_max_sed_lines`
11940- fi
11941- done
11942- if test -z "$ac_sed_cmds"; then
11943- ac_sed_cmds=cat
11944+
11945+
11946+ac_delim='%!_!# '
11947+for ac_last_try in false false false false false :; do
11948+ cat >conf$$subs.sed <<_ACEOF
11949+SHELL!$SHELL$ac_delim
11950+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
11951+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
11952+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
11953+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
11954+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
11955+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
11956+exec_prefix!$exec_prefix$ac_delim
11957+prefix!$prefix$ac_delim
11958+program_transform_name!$program_transform_name$ac_delim
11959+bindir!$bindir$ac_delim
11960+sbindir!$sbindir$ac_delim
11961+libexecdir!$libexecdir$ac_delim
11962+datarootdir!$datarootdir$ac_delim
11963+datadir!$datadir$ac_delim
11964+sysconfdir!$sysconfdir$ac_delim
11965+sharedstatedir!$sharedstatedir$ac_delim
11966+localstatedir!$localstatedir$ac_delim
11967+includedir!$includedir$ac_delim
11968+oldincludedir!$oldincludedir$ac_delim
11969+docdir!$docdir$ac_delim
11970+infodir!$infodir$ac_delim
11971+htmldir!$htmldir$ac_delim
11972+dvidir!$dvidir$ac_delim
11973+pdfdir!$pdfdir$ac_delim
11974+psdir!$psdir$ac_delim
11975+libdir!$libdir$ac_delim
11976+localedir!$localedir$ac_delim
11977+mandir!$mandir$ac_delim
11978+DEFS!$DEFS$ac_delim
11979+ECHO_C!$ECHO_C$ac_delim
11980+ECHO_N!$ECHO_N$ac_delim
11981+ECHO_T!$ECHO_T$ac_delim
11982+LIBS!$LIBS$ac_delim
11983+build_alias!$build_alias$ac_delim
11984+host_alias!$host_alias$ac_delim
11985+target_alias!$target_alias$ac_delim
11986+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
11987+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
11988+INSTALL_DATA!$INSTALL_DATA$ac_delim
11989+am__isrc!$am__isrc$ac_delim
11990+CYGPATH_W!$CYGPATH_W$ac_delim
11991+PACKAGE!$PACKAGE$ac_delim
11992+VERSION!$VERSION$ac_delim
11993+ACLOCAL!$ACLOCAL$ac_delim
11994+AUTOCONF!$AUTOCONF$ac_delim
11995+AUTOMAKE!$AUTOMAKE$ac_delim
11996+AUTOHEADER!$AUTOHEADER$ac_delim
11997+MAKEINFO!$MAKEINFO$ac_delim
11998+install_sh!$install_sh$ac_delim
11999+STRIP!$STRIP$ac_delim
12000+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
12001+mkdir_p!$mkdir_p$ac_delim
12002+AWK!$AWK$ac_delim
12003+SET_MAKE!$SET_MAKE$ac_delim
12004+am__leading_dot!$am__leading_dot$ac_delim
12005+AMTAR!$AMTAR$ac_delim
12006+am__tar!$am__tar$ac_delim
12007+am__untar!$am__untar$ac_delim
12008+CC!$CC$ac_delim
12009+CFLAGS!$CFLAGS$ac_delim
12010+LDFLAGS!$LDFLAGS$ac_delim
12011+CPPFLAGS!$CPPFLAGS$ac_delim
12012+ac_ct_CC!$ac_ct_CC$ac_delim
12013+EXEEXT!$EXEEXT$ac_delim
12014+OBJEXT!$OBJEXT$ac_delim
12015+DEPDIR!$DEPDIR$ac_delim
12016+am__include!$am__include$ac_delim
12017+am__quote!$am__quote$ac_delim
12018+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
12019+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
12020+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
12021+CCDEPMODE!$CCDEPMODE$ac_delim
12022+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
12023+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
12024+YACC!$YACC$ac_delim
12025+YFLAGS!$YFLAGS$ac_delim
12026+CC_FOR_BUILD!$CC_FOR_BUILD$ac_delim
12027+CPP!$CPP$ac_delim
12028+GREP!$GREP$ac_delim
12029+EGREP!$EGREP$ac_delim
12030+LIBOBJS!$LIBOBJS$ac_delim
12031+LTLIBOBJS!$LTLIBOBJS$ac_delim
12032+_ACEOF
12033+
12034+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 83; then
12035+ break
12036+ elif $ac_last_try; then
12037+ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
12038+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
12039+ { (exit 1); exit 1; }; }
12040+ else
12041+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
12042 fi
12043-fi # test -n "$CONFIG_FILES"
12044+done
12045
12046+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
12047+if test -n "$ac_eof"; then
12048+ ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
12049+ ac_eof=`expr $ac_eof + 1`
12050+fi
12051+
12052+cat >>$CONFIG_STATUS <<_ACEOF
12053+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
12054+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
12055+_ACEOF
12056+sed '
12057+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
12058+s/^/s,@/; s/!/@,|#_!!_#|/
12059+:n
12060+t n
12061+s/'"$ac_delim"'$/,g/; t
12062+s/$/\\/; p
12063+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
12064+' >>$CONFIG_STATUS <conf$$subs.sed
12065+rm -f conf$$subs.sed
12066+cat >>$CONFIG_STATUS <<_ACEOF
12067+:end
12068+s/|#_!!_#|//g
12069+CEOF$ac_eof
12070 _ACEOF
12071+
12072+
12073+# VPATH may cause trouble with some makes, so we remove $(srcdir),
12074+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
12075+# trailing colons and then remove the whole line if VPATH becomes empty
12076+# (actually we leave an empty line to preserve line numbers).
12077+if test "x$srcdir" = x.; then
12078+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
12079+s/:*\$(srcdir):*/:/
12080+s/:*\${srcdir}:*/:/
12081+s/:*@srcdir@:*/:/
12082+s/^\([^=]*=[ ]*\):*/\1/
12083+s/:*$//
12084+s/^[^=]*=[ ]*$//
12085+}'
12086+fi
12087+
12088 cat >>$CONFIG_STATUS <<\_ACEOF
12089-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
12090- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12091- case $ac_file in
12092- - | *:- | *:-:* ) # input from stdin
12093- cat >$tmp/stdin
12094- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12095- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12096- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12097- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12098- * ) ac_file_in=$ac_file.in ;;
12099+fi # test -n "$CONFIG_FILES"
12100+
12101+
12102+for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS
12103+do
12104+ case $ac_tag in
12105+ :[FHLC]) ac_mode=$ac_tag; continue;;
12106+ esac
12107+ case $ac_mode$ac_tag in
12108+ :[FHL]*:*);;
12109+ :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
12110+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
12111+ { (exit 1); exit 1; }; };;
12112+ :[FH]-) ac_tag=-:-;;
12113+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
12114+ esac
12115+ ac_save_IFS=$IFS
12116+ IFS=:
12117+ set x $ac_tag
12118+ IFS=$ac_save_IFS
12119+ shift
12120+ ac_file=$1
12121+ shift
12122+
12123+ case $ac_mode in
12124+ :L) ac_source=$1;;
12125+ :[FH])
12126+ ac_file_inputs=
12127+ for ac_f
12128+ do
12129+ case $ac_f in
12130+ -) ac_f="$tmp/stdin";;
12131+ *) # Look for the file first in the build tree, then in the source tree
12132+ # (if the path is not absolute). The absolute path cannot be DOS-style,
12133+ # because $ac_f cannot contain `:'.
12134+ test -f "$ac_f" ||
12135+ case $ac_f in
12136+ [\\/$]*) false;;
12137+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
12138+ esac ||
12139+ { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
12140+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
12141+ { (exit 1); exit 1; }; };;
12142+ esac
12143+ ac_file_inputs="$ac_file_inputs $ac_f"
12144+ done
12145+
12146+ # Let's still pretend it is `configure' which instantiates (i.e., don't
12147+ # use $as_me), people would be surprised to read:
12148+ # /* config.h. Generated by config.status. */
12149+ configure_input="Generated from "`IFS=:
12150+ echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
12151+ if test x"$ac_file" != x-; then
12152+ configure_input="$ac_file. $configure_input"
12153+ { echo "$as_me:$LINENO: creating $ac_file" >&5
12154+echo "$as_me: creating $ac_file" >&6;}
12155+ fi
12156+
12157+ case $ac_tag in
12158+ *:-:* | *:-) cat >"$tmp/stdin";;
12159+ esac
12160+ ;;
12161 esac
12162
12163- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
12164- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
12165+ ac_dir=`$as_dirname -- "$ac_file" ||
12166 $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12167 X"$ac_file" : 'X\(//\)[^/]' \| \
12168 X"$ac_file" : 'X\(//\)$' \| \
12169- X"$ac_file" : 'X\(/\)' \| \
12170- . : '\(.\)' 2>/dev/null ||
12171+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
12172 echo X"$ac_file" |
12173- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12174- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12175- /^X\(\/\/\)$/{ s//\1/; q; }
12176- /^X\(\/\).*/{ s//\1/; q; }
12177- s/.*/./; q'`
12178- { if $as_mkdir_p; then
12179- mkdir -p "$ac_dir"
12180- else
12181- as_dir="$ac_dir"
12182+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
12183+ s//\1/
12184+ q
12185+ }
12186+ /^X\(\/\/\)[^/].*/{
12187+ s//\1/
12188+ q
12189+ }
12190+ /^X\(\/\/\)$/{
12191+ s//\1/
12192+ q
12193+ }
12194+ /^X\(\/\).*/{
12195+ s//\1/
12196+ q
12197+ }
12198+ s/.*/./; q'`
12199+ { as_dir="$ac_dir"
12200+ case $as_dir in #(
12201+ -*) as_dir=./$as_dir;;
12202+ esac
12203+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
12204 as_dirs=
12205- while test ! -d "$as_dir"; do
12206- as_dirs="$as_dir $as_dirs"
12207- as_dir=`(dirname "$as_dir") 2>/dev/null ||
12208+ while :; do
12209+ case $as_dir in #(
12210+ *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
12211+ *) as_qdir=$as_dir;;
12212+ esac
12213+ as_dirs="'$as_qdir' $as_dirs"
12214+ as_dir=`$as_dirname -- "$as_dir" ||
12215 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12216 X"$as_dir" : 'X\(//\)[^/]' \| \
12217 X"$as_dir" : 'X\(//\)$' \| \
12218- X"$as_dir" : 'X\(/\)' \| \
12219- . : '\(.\)' 2>/dev/null ||
12220+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
12221 echo X"$as_dir" |
12222- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12223- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12224- /^X\(\/\/\)$/{ s//\1/; q; }
12225- /^X\(\/\).*/{ s//\1/; q; }
12226- s/.*/./; q'`
12227+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
12228+ s//\1/
12229+ q
12230+ }
12231+ /^X\(\/\/\)[^/].*/{
12232+ s//\1/
12233+ q
12234+ }
12235+ /^X\(\/\/\)$/{
12236+ s//\1/
12237+ q
12238+ }
12239+ /^X\(\/\).*/{
12240+ s//\1/
12241+ q
12242+ }
12243+ s/.*/./; q'`
12244+ test -d "$as_dir" && break
12245 done
12246- test ! -n "$as_dirs" || mkdir $as_dirs
12247- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
12248-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
12249+ test -z "$as_dirs" || eval "mkdir $as_dirs"
12250+ } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
12251+echo "$as_me: error: cannot create directory $as_dir" >&2;}
12252 { (exit 1); exit 1; }; }; }
12253-
12254 ac_builddir=.
12255
12256-if test "$ac_dir" != .; then
12257+case "$ac_dir" in
12258+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
12259+*)
12260 ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
12261- # A "../" for each directory in $ac_dir_suffix.
12262- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
12263-else
12264- ac_dir_suffix= ac_top_builddir=
12265-fi
12266+ # A ".." for each directory in $ac_dir_suffix.
12267+ ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
12268+ case $ac_top_builddir_sub in
12269+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
12270+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
12271+ esac ;;
12272+esac
12273+ac_abs_top_builddir=$ac_pwd
12274+ac_abs_builddir=$ac_pwd$ac_dir_suffix
12275+# for backward compatibility:
12276+ac_top_builddir=$ac_top_build_prefix
12277
12278 case $srcdir in
12279- .) # No --srcdir option. We are building in place.
12280+ .) # We are building in place.
12281 ac_srcdir=.
12282- if test -z "$ac_top_builddir"; then
12283- ac_top_srcdir=.
12284- else
12285- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
12286- fi ;;
12287- [\\/]* | ?:[\\/]* ) # Absolute path.
12288+ ac_top_srcdir=$ac_top_builddir_sub
12289+ ac_abs_top_srcdir=$ac_pwd ;;
12290+ [\\/]* | ?:[\\/]* ) # Absolute name.
12291 ac_srcdir=$srcdir$ac_dir_suffix;
12292- ac_top_srcdir=$srcdir ;;
12293- *) # Relative path.
12294- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
12295- ac_top_srcdir=$ac_top_builddir$srcdir ;;
12296+ ac_top_srcdir=$srcdir
12297+ ac_abs_top_srcdir=$srcdir ;;
12298+ *) # Relative name.
12299+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
12300+ ac_top_srcdir=$ac_top_build_prefix$srcdir
12301+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
12302 esac
12303+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
12304
12305-# Do not use `cd foo && pwd` to compute absolute paths, because
12306-# the directories may not exist.
12307-case `pwd` in
12308-.) ac_abs_builddir="$ac_dir";;
12309-*)
12310- case "$ac_dir" in
12311- .) ac_abs_builddir=`pwd`;;
12312- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
12313- *) ac_abs_builddir=`pwd`/"$ac_dir";;
12314- esac;;
12315-esac
12316-case $ac_abs_builddir in
12317-.) ac_abs_top_builddir=${ac_top_builddir}.;;
12318-*)
12319- case ${ac_top_builddir}. in
12320- .) ac_abs_top_builddir=$ac_abs_builddir;;
12321- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
12322- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
12323- esac;;
12324-esac
12325-case $ac_abs_builddir in
12326-.) ac_abs_srcdir=$ac_srcdir;;
12327-*)
12328- case $ac_srcdir in
12329- .) ac_abs_srcdir=$ac_abs_builddir;;
12330- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
12331- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
12332- esac;;
12333-esac
12334-case $ac_abs_builddir in
12335-.) ac_abs_top_srcdir=$ac_top_srcdir;;
12336-*)
12337- case $ac_top_srcdir in
12338- .) ac_abs_top_srcdir=$ac_abs_builddir;;
12339- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
12340- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
12341- esac;;
12342-esac
12343
12344+ case $ac_mode in
12345+ :F)
12346+ #
12347+ # CONFIG_FILE
12348+ #
12349
12350 case $INSTALL in
12351 [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
12352- *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
12353+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
12354+ esac
12355+ ac_MKDIR_P=$MKDIR_P
12356+ case $MKDIR_P in
12357+ [\\/$]* | ?:[\\/]* ) ;;
12358+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
12359 esac
12360+_ACEOF
12361
12362- # Let's still pretend it is `configure' which instantiates (i.e., don't
12363- # use $as_me), people would be surprised to read:
12364- # /* config.h. Generated by config.status. */
12365- if test x"$ac_file" = x-; then
12366- configure_input=
12367- else
12368- configure_input="$ac_file. "
12369- fi
12370- configure_input=$configure_input"Generated from `echo $ac_file_in |
12371- sed 's,.*/,,'` by configure."
12372-
12373- # First look for the input files in the build tree, otherwise in the
12374- # src tree.
12375- ac_file_inputs=`IFS=:
12376- for f in $ac_file_in; do
12377- case $f in
12378- -) echo $tmp/stdin ;;
12379- [\\/$]*)
12380- # Absolute (can't be DOS-style, as IFS=:)
12381- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
12382-echo "$as_me: error: cannot find input file: $f" >&2;}
12383- { (exit 1); exit 1; }; }
12384- echo "$f";;
12385- *) # Relative
12386- if test -f "$f"; then
12387- # Build tree
12388- echo "$f"
12389- elif test -f "$srcdir/$f"; then
12390- # Source tree
12391- echo "$srcdir/$f"
12392- else
12393- # /dev/null tree
12394- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
12395-echo "$as_me: error: cannot find input file: $f" >&2;}
12396- { (exit 1); exit 1; }; }
12397- fi;;
12398- esac
12399- done` || { (exit 1); exit 1; }
12400+cat >>$CONFIG_STATUS <<\_ACEOF
12401+# If the template does not know about datarootdir, expand it.
12402+# FIXME: This hack should be removed a few years after 2.60.
12403+ac_datarootdir_hack=; ac_datarootdir_seen=
12404
12405- if test x"$ac_file" != x-; then
12406- { echo "$as_me:$LINENO: creating $ac_file" >&5
12407-echo "$as_me: creating $ac_file" >&6;}
12408- rm -f "$ac_file"
12409- fi
12410+case `sed -n '/datarootdir/ {
12411+ p
12412+ q
12413+}
12414+/@datadir@/p
12415+/@docdir@/p
12416+/@infodir@/p
12417+/@localedir@/p
12418+/@mandir@/p
12419+' $ac_file_inputs` in
12420+*datarootdir*) ac_datarootdir_seen=yes;;
12421+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
12422+ { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
12423+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
12424 _ACEOF
12425 cat >>$CONFIG_STATUS <<_ACEOF
12426+ ac_datarootdir_hack='
12427+ s&@datadir@&$datadir&g
12428+ s&@docdir@&$docdir&g
12429+ s&@infodir@&$infodir&g
12430+ s&@localedir@&$localedir&g
12431+ s&@mandir@&$mandir&g
12432+ s&\\\${datarootdir}&$datarootdir&g' ;;
12433+esac
12434+_ACEOF
12435+
12436+# Neutralize VPATH when `$srcdir' = `.'.
12437+# Shell code in configure.ac might set extrasub.
12438+# FIXME: do we really want to maintain this feature?
12439+cat >>$CONFIG_STATUS <<_ACEOF
12440 sed "$ac_vpsub
12441 $extrasub
12442 _ACEOF
12443 cat >>$CONFIG_STATUS <<\_ACEOF
12444 :t
12445 /@[a-zA-Z_][a-zA-Z_0-9]*@/!b
12446-s,@configure_input@,$configure_input,;t t
12447-s,@srcdir@,$ac_srcdir,;t t
12448-s,@abs_srcdir@,$ac_abs_srcdir,;t t
12449-s,@top_srcdir@,$ac_top_srcdir,;t t
12450-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
12451-s,@builddir@,$ac_builddir,;t t
12452-s,@abs_builddir@,$ac_abs_builddir,;t t
12453-s,@top_builddir@,$ac_top_builddir,;t t
12454-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
12455-s,@INSTALL@,$ac_INSTALL,;t t
12456-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
12457- rm -f $tmp/stdin
12458- if test x"$ac_file" != x-; then
12459- mv $tmp/out $ac_file
12460- else
12461- cat $tmp/out
12462- rm -f $tmp/out
12463- fi
12464-
12465-done
12466-_ACEOF
12467-cat >>$CONFIG_STATUS <<\_ACEOF
12468-
12469-#
12470-# CONFIG_HEADER section.
12471-#
12472-
12473-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
12474-# NAME is the cpp macro being defined and VALUE is the value it is being given.
12475-#
12476-# ac_d sets the value in "#define NAME VALUE" lines.
12477-ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
12478-ac_dB='[ ].*$,\1#\2'
12479-ac_dC=' '
12480-ac_dD=',;t'
12481-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
12482-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
12483-ac_uB='$,\1#\2define\3'
12484-ac_uC=' '
12485-ac_uD=',;t'
12486-
12487-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
12488- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
12489+s&@configure_input@&$configure_input&;t t
12490+s&@top_builddir@&$ac_top_builddir_sub&;t t
12491+s&@srcdir@&$ac_srcdir&;t t
12492+s&@abs_srcdir@&$ac_abs_srcdir&;t t
12493+s&@top_srcdir@&$ac_top_srcdir&;t t
12494+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
12495+s&@builddir@&$ac_builddir&;t t
12496+s&@abs_builddir@&$ac_abs_builddir&;t t
12497+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
12498+s&@INSTALL@&$ac_INSTALL&;t t
12499+s&@MKDIR_P@&$ac_MKDIR_P&;t t
12500+$ac_datarootdir_hack
12501+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
12502+
12503+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
12504+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
12505+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
12506+ { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
12507+which seems to be undefined. Please make sure it is defined." >&5
12508+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
12509+which seems to be undefined. Please make sure it is defined." >&2;}
12510+
12511+ rm -f "$tmp/stdin"
12512 case $ac_file in
12513- - | *:- | *:-:* ) # input from stdin
12514- cat >$tmp/stdin
12515- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12516- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12517- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
12518- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
12519- * ) ac_file_in=$ac_file.in ;;
12520+ -) cat "$tmp/out"; rm -f "$tmp/out";;
12521+ *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
12522 esac
12523-
12524- test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
12525-echo "$as_me: creating $ac_file" >&6;}
12526-
12527- # First look for the input files in the build tree, otherwise in the
12528- # src tree.
12529- ac_file_inputs=`IFS=:
12530- for f in $ac_file_in; do
12531- case $f in
12532- -) echo $tmp/stdin ;;
12533- [\\/$]*)
12534- # Absolute (can't be DOS-style, as IFS=:)
12535- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
12536-echo "$as_me: error: cannot find input file: $f" >&2;}
12537- { (exit 1); exit 1; }; }
12538- # Do quote $f, to prevent DOS paths from being IFS'd.
12539- echo "$f";;
12540- *) # Relative
12541- if test -f "$f"; then
12542- # Build tree
12543- echo "$f"
12544- elif test -f "$srcdir/$f"; then
12545- # Source tree
12546- echo "$srcdir/$f"
12547- else
12548- # /dev/null tree
12549- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
12550-echo "$as_me: error: cannot find input file: $f" >&2;}
12551- { (exit 1); exit 1; }; }
12552- fi;;
12553- esac
12554- done` || { (exit 1); exit 1; }
12555- # Remove the trailing spaces.
12556- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
12557-
12558+ ;;
12559+ :H)
12560+ #
12561+ # CONFIG_HEADER
12562+ #
12563 _ACEOF
12564
12565-# Transform confdefs.h into two sed scripts, `conftest.defines' and
12566-# `conftest.undefs', that substitutes the proper values into
12567-# config.h.in to produce config.h. The first handles `#define'
12568-# templates, and the second `#undef' templates.
12569-# And first: Protect against being on the right side of a sed subst in
12570-# config.status. Protect against being in an unquoted here document
12571-# in config.status.
12572-rm -f conftest.defines conftest.undefs
12573-# Using a here document instead of a string reduces the quoting nightmare.
12574-# Putting comments in sed scripts is not portable.
12575-#
12576-# `end' is used to avoid that the second main sed command (meant for
12577-# 0-ary CPP macros) applies to n-ary macro definitions.
12578-# See the Autoconf documentation for `clear'.
12579-cat >confdef2sed.sed <<\_ACEOF
12580-s/[\\&,]/\\&/g
12581-s,[\\$`],\\&,g
12582-t clear
12583-: clear
12584-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
12585-t end
12586-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
12587-: end
12588-_ACEOF
12589-# If some macros were called several times there might be several times
12590-# the same #defines, which is useless. Nevertheless, we may not want to
12591-# sort them, since we want the *last* AC-DEFINE to be honored.
12592-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
12593-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
12594-rm -f confdef2sed.sed
12595-
12596-# This sed command replaces #undef with comments. This is necessary, for
12597+# Transform confdefs.h into a sed script `conftest.defines', that
12598+# substitutes the proper values into config.h.in to produce config.h.
12599+rm -f conftest.defines conftest.tail
12600+# First, append a space to every undef/define line, to ease matching.
12601+echo 's/$/ /' >conftest.defines
12602+# Then, protect against being on the right side of a sed subst, or in
12603+# an unquoted here document, in config.status. If some macros were
12604+# called several times there might be several #defines for the same
12605+# symbol, which is useless. But do not sort them, since the last
12606+# AC_DEFINE must be honored.
12607+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
12608+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
12609+# NAME is the cpp macro being defined, VALUE is the value it is being given.
12610+# PARAMS is the parameter list in the macro definition--in most cases, it's
12611+# just an empty string.
12612+ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
12613+ac_dB='\\)[ (].*,\\1define\\2'
12614+ac_dC=' '
12615+ac_dD=' ,'
12616+
12617+uniq confdefs.h |
12618+ sed -n '
12619+ t rset
12620+ :rset
12621+ s/^[ ]*#[ ]*define[ ][ ]*//
12622+ t ok
12623+ d
12624+ :ok
12625+ s/[\\&,]/\\&/g
12626+ s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
12627+ s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
12628+ ' >>conftest.defines
12629+
12630+# Remove the space that was appended to ease matching.
12631+# Then replace #undef with comments. This is necessary, for
12632 # example, in the case of _POSIX_SOURCE, which is predefined and required
12633 # on some systems where configure will not decide to define it.
12634-cat >>conftest.undefs <<\_ACEOF
12635-s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
12636-_ACEOF
12637-
12638-# Break up conftest.defines because some shells have a limit on the size
12639-# of here documents, and old seds have small limits too (100 cmds).
12640-echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
12641-echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
12642-echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
12643-echo ' :' >>$CONFIG_STATUS
12644-rm -f conftest.tail
12645-while grep . conftest.defines >/dev/null
12646+# (The regexp can be short, since the line contains either #define or #undef.)
12647+echo 's/ $//
12648+s,^[ #]*u.*,/* & */,' >>conftest.defines
12649+
12650+# Break up conftest.defines:
12651+ac_max_sed_lines=50
12652+
12653+# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
12654+# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
12655+# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
12656+# et cetera.
12657+ac_in='$ac_file_inputs'
12658+ac_out='"$tmp/out1"'
12659+ac_nxt='"$tmp/out2"'
12660+
12661+while :
12662 do
12663- # Write a limited-size here document to $tmp/defines.sed.
12664- echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
12665- # Speed up: don't consider the non `#define' lines.
12666- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
12667- # Work around the forget-to-reset-the-flag bug.
12668- echo 't clr' >>$CONFIG_STATUS
12669- echo ': clr' >>$CONFIG_STATUS
12670- sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
12671+ # Write a here document:
12672+ cat >>$CONFIG_STATUS <<_ACEOF
12673+ # First, check the format of the line:
12674+ cat >"\$tmp/defines.sed" <<\\CEOF
12675+/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
12676+/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
12677+b
12678+:def
12679+_ACEOF
12680+ sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
12681 echo 'CEOF
12682- sed -f $tmp/defines.sed $tmp/in >$tmp/out
12683- rm -f $tmp/in
12684- mv $tmp/out $tmp/in
12685-' >>$CONFIG_STATUS
12686- sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
12687+ sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
12688+ ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
12689+ sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
12690+ grep . conftest.tail >/dev/null || break
12691 rm -f conftest.defines
12692 mv conftest.tail conftest.defines
12693 done
12694-rm -f conftest.defines
12695-echo ' fi # grep' >>$CONFIG_STATUS
12696-echo >>$CONFIG_STATUS
12697-
12698-# Break up conftest.undefs because some shells have a limit on the size
12699-# of here documents, and old seds have small limits too (100 cmds).
12700-echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
12701-rm -f conftest.tail
12702-while grep . conftest.undefs >/dev/null
12703-do
12704- # Write a limited-size here document to $tmp/undefs.sed.
12705- echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
12706- # Speed up: don't consider the non `#undef'
12707- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
12708- # Work around the forget-to-reset-the-flag bug.
12709- echo 't clr' >>$CONFIG_STATUS
12710- echo ': clr' >>$CONFIG_STATUS
12711- sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
12712- echo 'CEOF
12713- sed -f $tmp/undefs.sed $tmp/in >$tmp/out
12714- rm -f $tmp/in
12715- mv $tmp/out $tmp/in
12716-' >>$CONFIG_STATUS
12717- sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
12718- rm -f conftest.undefs
12719- mv conftest.tail conftest.undefs
12720-done
12721-rm -f conftest.undefs
12722+rm -f conftest.defines conftest.tail
12723
12724+echo "ac_result=$ac_in" >>$CONFIG_STATUS
12725 cat >>$CONFIG_STATUS <<\_ACEOF
12726- # Let's still pretend it is `configure' which instantiates (i.e., don't
12727- # use $as_me), people would be surprised to read:
12728- # /* config.h. Generated by config.status. */
12729- if test x"$ac_file" = x-; then
12730- echo "/* Generated by configure. */" >$tmp/config.h
12731- else
12732- echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
12733- fi
12734- cat $tmp/in >>$tmp/config.h
12735- rm -f $tmp/in
12736 if test x"$ac_file" != x-; then
12737- if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
12738+ echo "/* $configure_input */" >"$tmp/config.h"
12739+ cat "$ac_result" >>"$tmp/config.h"
12740+ if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
12741 { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
12742 echo "$as_me: $ac_file is unchanged" >&6;}
12743 else
12744- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
12745-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12746- X"$ac_file" : 'X\(//\)[^/]' \| \
12747- X"$ac_file" : 'X\(//\)$' \| \
12748- X"$ac_file" : 'X\(/\)' \| \
12749- . : '\(.\)' 2>/dev/null ||
12750-echo X"$ac_file" |
12751- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12752- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12753- /^X\(\/\/\)$/{ s//\1/; q; }
12754- /^X\(\/\).*/{ s//\1/; q; }
12755- s/.*/./; q'`
12756- { if $as_mkdir_p; then
12757- mkdir -p "$ac_dir"
12758- else
12759- as_dir="$ac_dir"
12760- as_dirs=
12761- while test ! -d "$as_dir"; do
12762- as_dirs="$as_dir $as_dirs"
12763- as_dir=`(dirname "$as_dir") 2>/dev/null ||
12764-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12765- X"$as_dir" : 'X\(//\)[^/]' \| \
12766- X"$as_dir" : 'X\(//\)$' \| \
12767- X"$as_dir" : 'X\(/\)' \| \
12768- . : '\(.\)' 2>/dev/null ||
12769-echo X"$as_dir" |
12770- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12771- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12772- /^X\(\/\/\)$/{ s//\1/; q; }
12773- /^X\(\/\).*/{ s//\1/; q; }
12774- s/.*/./; q'`
12775- done
12776- test ! -n "$as_dirs" || mkdir $as_dirs
12777- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
12778-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
12779- { (exit 1); exit 1; }; }; }
12780-
12781 rm -f $ac_file
12782- mv $tmp/config.h $ac_file
12783+ mv "$tmp/config.h" $ac_file
12784 fi
12785 else
12786- cat $tmp/config.h
12787- rm -f $tmp/config.h
12788+ echo "/* $configure_input */"
12789+ cat "$ac_result"
12790 fi
12791+ rm -f "$tmp/out12"
12792 # Compute $ac_file's index in $config_headers.
12793 _am_stamp_count=1
12794 for _am_header in $config_headers :; do
12795@@ -5207,135 +5982,39 @@ for _am_header in $config_headers :; do
12796 _am_stamp_count=`expr $_am_stamp_count + 1` ;;
12797 esac
12798 done
12799-echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
12800+echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
12801 $as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12802 X$ac_file : 'X\(//\)[^/]' \| \
12803 X$ac_file : 'X\(//\)$' \| \
12804- X$ac_file : 'X\(/\)' \| \
12805- . : '\(.\)' 2>/dev/null ||
12806+ X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
12807 echo X$ac_file |
12808- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12809- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12810- /^X\(\/\/\)$/{ s//\1/; q; }
12811- /^X\(\/\).*/{ s//\1/; q; }
12812- s/.*/./; q'`/stamp-h$_am_stamp_count
12813-done
12814-_ACEOF
12815-cat >>$CONFIG_STATUS <<\_ACEOF
12816-
12817-#
12818-# CONFIG_COMMANDS section.
12819-#
12820-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
12821- ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
12822- ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
12823- ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
12824-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12825- X"$ac_dest" : 'X\(//\)[^/]' \| \
12826- X"$ac_dest" : 'X\(//\)$' \| \
12827- X"$ac_dest" : 'X\(/\)' \| \
12828- . : '\(.\)' 2>/dev/null ||
12829-echo X"$ac_dest" |
12830- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12831- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12832- /^X\(\/\/\)$/{ s//\1/; q; }
12833- /^X\(\/\).*/{ s//\1/; q; }
12834- s/.*/./; q'`
12835- { if $as_mkdir_p; then
12836- mkdir -p "$ac_dir"
12837- else
12838- as_dir="$ac_dir"
12839- as_dirs=
12840- while test ! -d "$as_dir"; do
12841- as_dirs="$as_dir $as_dirs"
12842- as_dir=`(dirname "$as_dir") 2>/dev/null ||
12843-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12844- X"$as_dir" : 'X\(//\)[^/]' \| \
12845- X"$as_dir" : 'X\(//\)$' \| \
12846- X"$as_dir" : 'X\(/\)' \| \
12847- . : '\(.\)' 2>/dev/null ||
12848-echo X"$as_dir" |
12849- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12850- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12851- /^X\(\/\/\)$/{ s//\1/; q; }
12852- /^X\(\/\).*/{ s//\1/; q; }
12853- s/.*/./; q'`
12854- done
12855- test ! -n "$as_dirs" || mkdir $as_dirs
12856- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
12857-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
12858- { (exit 1); exit 1; }; }; }
12859-
12860- ac_builddir=.
12861-
12862-if test "$ac_dir" != .; then
12863- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
12864- # A "../" for each directory in $ac_dir_suffix.
12865- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
12866-else
12867- ac_dir_suffix= ac_top_builddir=
12868-fi
12869-
12870-case $srcdir in
12871- .) # No --srcdir option. We are building in place.
12872- ac_srcdir=.
12873- if test -z "$ac_top_builddir"; then
12874- ac_top_srcdir=.
12875- else
12876- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
12877- fi ;;
12878- [\\/]* | ?:[\\/]* ) # Absolute path.
12879- ac_srcdir=$srcdir$ac_dir_suffix;
12880- ac_top_srcdir=$srcdir ;;
12881- *) # Relative path.
12882- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
12883- ac_top_srcdir=$ac_top_builddir$srcdir ;;
12884-esac
12885+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
12886+ s//\1/
12887+ q
12888+ }
12889+ /^X\(\/\/\)[^/].*/{
12890+ s//\1/
12891+ q
12892+ }
12893+ /^X\(\/\/\)$/{
12894+ s//\1/
12895+ q
12896+ }
12897+ /^X\(\/\).*/{
12898+ s//\1/
12899+ q
12900+ }
12901+ s/.*/./; q'`/stamp-h$_am_stamp_count
12902+ ;;
12903
12904-# Do not use `cd foo && pwd` to compute absolute paths, because
12905-# the directories may not exist.
12906-case `pwd` in
12907-.) ac_abs_builddir="$ac_dir";;
12908-*)
12909- case "$ac_dir" in
12910- .) ac_abs_builddir=`pwd`;;
12911- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
12912- *) ac_abs_builddir=`pwd`/"$ac_dir";;
12913- esac;;
12914-esac
12915-case $ac_abs_builddir in
12916-.) ac_abs_top_builddir=${ac_top_builddir}.;;
12917-*)
12918- case ${ac_top_builddir}. in
12919- .) ac_abs_top_builddir=$ac_abs_builddir;;
12920- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
12921- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
12922- esac;;
12923-esac
12924-case $ac_abs_builddir in
12925-.) ac_abs_srcdir=$ac_srcdir;;
12926-*)
12927- case $ac_srcdir in
12928- .) ac_abs_srcdir=$ac_abs_builddir;;
12929- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
12930- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
12931- esac;;
12932-esac
12933-case $ac_abs_builddir in
12934-.) ac_abs_top_srcdir=$ac_top_srcdir;;
12935-*)
12936- case $ac_top_srcdir in
12937- .) ac_abs_top_srcdir=$ac_abs_builddir;;
12938- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
12939- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
12940- esac;;
12941-esac
12942+ :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
12943+echo "$as_me: executing $ac_file commands" >&6;}
12944+ ;;
12945+ esac
12946
12947
12948- { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
12949-echo "$as_me: executing $ac_dest commands" >&6;}
12950- case $ac_dest in
12951- depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
12952+ case $ac_file$ac_mode in
12953+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
12954 # Strip MF so we end up with the name of the file.
12955 mf=`echo "$mf" | sed -e 's/:.*$//'`
12956 # Check whether this is an Automake generated Makefile or not.
12957@@ -5343,20 +6022,32 @@ echo "$as_me: executing $ac_dest commands" >&6;}
12958 # some people rename them; so instead we look at the file content.
12959 # Grep'ing the first line is not enough: some people post-process
12960 # each Makefile.in and add a new line on top of each file to say so.
12961- # So let's grep whole file.
12962- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
12963- dirpart=`(dirname "$mf") 2>/dev/null ||
12964+ # Grep'ing the whole file is not good either: AIX grep has a line
12965+ # limit of 2048, but all sed's we know have understand at least 4000.
12966+ if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
12967+ dirpart=`$as_dirname -- "$mf" ||
12968 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
12969 X"$mf" : 'X\(//\)[^/]' \| \
12970 X"$mf" : 'X\(//\)$' \| \
12971- X"$mf" : 'X\(/\)' \| \
12972- . : '\(.\)' 2>/dev/null ||
12973+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
12974 echo X"$mf" |
12975- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
12976- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
12977- /^X\(\/\/\)$/{ s//\1/; q; }
12978- /^X\(\/\).*/{ s//\1/; q; }
12979- s/.*/./; q'`
12980+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
12981+ s//\1/
12982+ q
12983+ }
12984+ /^X\(\/\/\)[^/].*/{
12985+ s//\1/
12986+ q
12987+ }
12988+ /^X\(\/\/\)$/{
12989+ s//\1/
12990+ q
12991+ }
12992+ /^X\(\/\).*/{
12993+ s//\1/
12994+ q
12995+ }
12996+ s/.*/./; q'`
12997 else
12998 continue
12999 fi
13000@@ -5378,53 +6069,79 @@ echo X"$mf" |
13001 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
13002 # Make sure the directory exists.
13003 test -f "$dirpart/$file" && continue
13004- fdir=`(dirname "$file") 2>/dev/null ||
13005+ fdir=`$as_dirname -- "$file" ||
13006 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13007 X"$file" : 'X\(//\)[^/]' \| \
13008 X"$file" : 'X\(//\)$' \| \
13009- X"$file" : 'X\(/\)' \| \
13010- . : '\(.\)' 2>/dev/null ||
13011+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
13012 echo X"$file" |
13013- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
13014- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
13015- /^X\(\/\/\)$/{ s//\1/; q; }
13016- /^X\(\/\).*/{ s//\1/; q; }
13017- s/.*/./; q'`
13018- { if $as_mkdir_p; then
13019- mkdir -p $dirpart/$fdir
13020- else
13021- as_dir=$dirpart/$fdir
13022+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
13023+ s//\1/
13024+ q
13025+ }
13026+ /^X\(\/\/\)[^/].*/{
13027+ s//\1/
13028+ q
13029+ }
13030+ /^X\(\/\/\)$/{
13031+ s//\1/
13032+ q
13033+ }
13034+ /^X\(\/\).*/{
13035+ s//\1/
13036+ q
13037+ }
13038+ s/.*/./; q'`
13039+ { as_dir=$dirpart/$fdir
13040+ case $as_dir in #(
13041+ -*) as_dir=./$as_dir;;
13042+ esac
13043+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
13044 as_dirs=
13045- while test ! -d "$as_dir"; do
13046- as_dirs="$as_dir $as_dirs"
13047- as_dir=`(dirname "$as_dir") 2>/dev/null ||
13048+ while :; do
13049+ case $as_dir in #(
13050+ *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
13051+ *) as_qdir=$as_dir;;
13052+ esac
13053+ as_dirs="'$as_qdir' $as_dirs"
13054+ as_dir=`$as_dirname -- "$as_dir" ||
13055 $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
13056 X"$as_dir" : 'X\(//\)[^/]' \| \
13057 X"$as_dir" : 'X\(//\)$' \| \
13058- X"$as_dir" : 'X\(/\)' \| \
13059- . : '\(.\)' 2>/dev/null ||
13060+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
13061 echo X"$as_dir" |
13062- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
13063- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
13064- /^X\(\/\/\)$/{ s//\1/; q; }
13065- /^X\(\/\).*/{ s//\1/; q; }
13066- s/.*/./; q'`
13067+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
13068+ s//\1/
13069+ q
13070+ }
13071+ /^X\(\/\/\)[^/].*/{
13072+ s//\1/
13073+ q
13074+ }
13075+ /^X\(\/\/\)$/{
13076+ s//\1/
13077+ q
13078+ }
13079+ /^X\(\/\).*/{
13080+ s//\1/
13081+ q
13082+ }
13083+ s/.*/./; q'`
13084+ test -d "$as_dir" && break
13085 done
13086- test ! -n "$as_dirs" || mkdir $as_dirs
13087- fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
13088-echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
13089+ test -z "$as_dirs" || eval "mkdir $as_dirs"
13090+ } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
13091+echo "$as_me: error: cannot create directory $as_dir" >&2;}
13092 { (exit 1); exit 1; }; }; }
13093-
13094 # echo "creating $dirpart/$file"
13095 echo '# dummy' > "$dirpart/$file"
13096 done
13097 done
13098 ;;
13099+
13100 esac
13101-done
13102-_ACEOF
13103+done # for ac_tag
13104
13105-cat >>$CONFIG_STATUS <<\_ACEOF
13106
13107 { (exit 0); exit 0; }
13108 _ACEOF
13109diff --git a/src/Makefile.in b/src/Makefile.in
13110index d5fb876..2b2ba34 100644
13111--- a/src/Makefile.in
13112+++ b/src/Makefile.in
13113@@ -1,8 +1,8 @@
13114-# Makefile.in generated by automake 1.9.5 from Makefile.am.
13115+# Makefile.in generated by automake 1.10 from Makefile.am.
13116 # @configure_input@
13117
13118 # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
13119-# 2003, 2004, 2005 Free Software Foundation, Inc.
13120+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
13121 # This Makefile.in is free software; the Free Software Foundation
13122 # gives unlimited permission to copy and/or distribute it,
13123 # with or without modifications, as long as this notice is preserved.
13124@@ -14,17 +14,11 @@
13125
13126 @SET_MAKE@
13127
13128-SOURCES = $(dash_SOURCES)
13129-
13130-srcdir = @srcdir@
13131-top_srcdir = @top_srcdir@
13132 VPATH = @srcdir@
13133 pkgdatadir = $(datadir)/@PACKAGE@
13134 pkglibdir = $(libdir)/@PACKAGE@
13135 pkgincludedir = $(includedir)/@PACKAGE@
13136-top_builddir = ..
13137 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
13138-INSTALL = @INSTALL@
13139 install_sh_DATA = $(install_sh) -c -m 644
13140 install_sh_PROGRAM = $(install_sh) -c
13141 install_sh_SCRIPT = $(install_sh) -c
13142@@ -38,8 +32,7 @@ PRE_UNINSTALL = :
13143 POST_UNINSTALL = :
13144 bin_PROGRAMS = dash$(EXEEXT)
13145 subdir = src
13146-DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in arith.c \
13147- arith.h
13148+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
13149 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
13150 am__aclocal_m4_deps = $(top_srcdir)/configure.ac
13151 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
13152@@ -50,25 +43,25 @@ CONFIG_CLEAN_FILES =
13153 am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"
13154 binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
13155 PROGRAMS = $(bin_PROGRAMS)
13156-am__objects_1 = alias.$(OBJEXT) arith_yylex.$(OBJEXT) cd.$(OBJEXT) \
13157- error.$(OBJEXT) eval.$(OBJEXT) exec.$(OBJEXT) expand.$(OBJEXT) \
13158+am__objects_1 = alias.$(OBJEXT) arith_yacc.$(OBJEXT) \
13159+ arith_yylex.$(OBJEXT) cd.$(OBJEXT) error.$(OBJEXT) \
13160+ eval.$(OBJEXT) exec.$(OBJEXT) expand.$(OBJEXT) \
13161 histedit.$(OBJEXT) input.$(OBJEXT) jobs.$(OBJEXT) \
13162 mail.$(OBJEXT) main.$(OBJEXT) memalloc.$(OBJEXT) \
13163 miscbltin.$(OBJEXT) mystring.$(OBJEXT) options.$(OBJEXT) \
13164 parser.$(OBJEXT) redir.$(OBJEXT) show.$(OBJEXT) trap.$(OBJEXT) \
13165 output.$(OBJEXT) printf.$(OBJEXT) system.$(OBJEXT) \
13166 test.$(OBJEXT) times.$(OBJEXT) var.$(OBJEXT)
13167-am_dash_OBJECTS = $(am__objects_1) arith.$(OBJEXT)
13168+am_dash_OBJECTS = $(am__objects_1)
13169 dash_OBJECTS = $(am_dash_OBJECTS)
13170 dash_DEPENDENCIES = builtins.o init.o nodes.o signames.o syntax.o
13171-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)
13172+DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
13173 depcomp = $(SHELL) $(top_srcdir)/depcomp
13174 am__depfiles_maybe = depfiles
13175 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
13176 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
13177 CCLD = $(CC)
13178 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
13179-YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
13180 SOURCES = $(dash_SOURCES)
13181 DIST_SOURCES = $(dash_SOURCES)
13182 man1dir = $(mandir)/man1
13183@@ -78,8 +71,6 @@ ETAGS = etags
13184 CTAGS = ctags
13185 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
13186 ACLOCAL = @ACLOCAL@
13187-AMDEP_FALSE = @AMDEP_FALSE@
13188-AMDEP_TRUE = @AMDEP_TRUE@
13189 AMTAR = @AMTAR@
13190 AUTOCONF = @AUTOCONF@
13191 AUTOHEADER = @AUTOHEADER@
13192@@ -99,6 +90,8 @@ ECHO_N = @ECHO_N@
13193 ECHO_T = @ECHO_T@
13194 EGREP = @EGREP@
13195 EXEEXT = @EXEEXT@
13196+GREP = @GREP@
13197+INSTALL = @INSTALL@
13198 INSTALL_DATA = @INSTALL_DATA@
13199 INSTALL_PROGRAM = @INSTALL_PROGRAM@
13200 INSTALL_SCRIPT = @INSTALL_SCRIPT@
13201@@ -108,6 +101,7 @@ LIBOBJS = @LIBOBJS@
13202 LIBS = @LIBS@
13203 LTLIBOBJS = @LTLIBOBJS@
13204 MAKEINFO = @MAKEINFO@
13205+MKDIR_P = @MKDIR_P@
13206 OBJEXT = @OBJEXT@
13207 PACKAGE = @PACKAGE@
13208 PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
13209@@ -121,10 +115,12 @@ SHELL = @SHELL@
13210 STRIP = @STRIP@
13211 VERSION = @VERSION@
13212 YACC = @YACC@
13213+YFLAGS = @YFLAGS@
13214+abs_builddir = @abs_builddir@
13215+abs_srcdir = @abs_srcdir@
13216+abs_top_builddir = @abs_top_builddir@
13217+abs_top_srcdir = @abs_top_srcdir@
13218 ac_ct_CC = @ac_ct_CC@
13219-ac_ct_STRIP = @ac_ct_STRIP@
13220-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
13221-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
13222 am__include = @am__include@
13223 am__leading_dot = @am__leading_dot@
13224 am__quote = @am__quote@
13225@@ -132,30 +128,41 @@ am__tar = @am__tar@
13226 am__untar = @am__untar@
13227 bindir = @bindir@
13228 build_alias = @build_alias@
13229+builddir = @builddir@
13230 datadir = @datadir@
13231+datarootdir = @datarootdir@
13232+docdir = @docdir@
13233+dvidir = @dvidir@
13234 exec_prefix = @exec_prefix@
13235 host_alias = @host_alias@
13236+htmldir = @htmldir@
13237 includedir = @includedir@
13238 infodir = @infodir@
13239 install_sh = @install_sh@
13240 libdir = @libdir@
13241 libexecdir = @libexecdir@
13242+localedir = @localedir@
13243 localstatedir = @localstatedir@
13244 mandir = @mandir@
13245 mkdir_p = @mkdir_p@
13246 oldincludedir = @oldincludedir@
13247+pdfdir = @pdfdir@
13248 prefix = @prefix@
13249 program_transform_name = @program_transform_name@
13250+psdir = @psdir@
13251 sbindir = @sbindir@
13252 sharedstatedir = @sharedstatedir@
13253+srcdir = @srcdir@
13254 sysconfdir = @sysconfdir@
13255 target_alias = @target_alias@
13256+top_builddir = @top_builddir@
13257+top_srcdir = @top_srcdir@
13258 AM_YFLAGS = -d
13259 COMMON_CFLAGS = -Wall
13260 COMMON_CPPFLAGS = \
13261 -include $(top_builddir)/config.h \
13262 -DBSD=1 -DSHELL \
13263- -DGLOB_BROKEN -DFNMATCH_BROKEN -DIFS_BROKEN
13264+ -DIFS_BROKEN
13265
13266 AM_CFLAGS = $(COMMON_CFLAGS)
13267 AM_CPPFLAGS = $(COMMON_CPPFLAGS)
13268@@ -166,13 +173,13 @@ COMPILE_FOR_BUILD = \
13269 $(AM_CFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD)
13270
13271 dash_CFILES = \
13272- alias.c arith_yylex.c cd.c error.c eval.c exec.c expand.c \
13273+ alias.c arith_yacc.c arith_yylex.c cd.c error.c eval.c exec.c expand.c \
13274 histedit.c input.c jobs.c mail.c main.c memalloc.c miscbltin.c \
13275 mystring.c options.c parser.c redir.c show.c trap.c output.c \
13276 bltin/printf.c system.c bltin/test.c bltin/times.c var.c
13277
13278 dash_SOURCES = \
13279- $(dash_CFILES) arith.y \
13280+ $(dash_CFILES) \
13281 alias.h bltin/bltin.h cd.h error.h eval.h exec.h expand.h hetio.h \
13282 init.h input.h jobs.h machdep.h mail.h main.h memalloc.h miscbltin.h \
13283 myhistedit.h mystring.h options.h output.h parser.h redir.h shell.h \
13284@@ -180,10 +187,10 @@ dash_SOURCES = \
13285
13286 dash_LDADD = builtins.o init.o nodes.o signames.o syntax.o
13287 HELPERS = mkinit mksyntax mknodes mksignames
13288-BUILT_SOURCES = arith.h builtins.h nodes.h syntax.h token.h
13289+BUILT_SOURCES = builtins.h nodes.h syntax.h token.h
13290 CLEANFILES = \
13291 $(BUILT_SOURCES) $(patsubst %.o,%.c,$(dash_LDADD)) \
13292- arith.c $(HELPERS) builtins.def
13293+ $(HELPERS) builtins.def
13294
13295 man_MANS = dash.1
13296 EXTRA_DIST = \
13297@@ -195,7 +202,7 @@ all: $(BUILT_SOURCES)
13298 $(MAKE) $(AM_MAKEFLAGS) all-am
13299
13300 .SUFFIXES:
13301-.SUFFIXES: .c .o .obj .y
13302+.SUFFIXES: .c .o .obj
13303 $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
13304 @for dep in $?; do \
13305 case '$(am__configure_deps)' in \
13306@@ -227,7 +234,7 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
13307 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
13308 install-binPROGRAMS: $(bin_PROGRAMS)
13309 @$(NORMAL_INSTALL)
13310- test -z "$(bindir)" || $(mkdir_p) "$(DESTDIR)$(bindir)"
13311+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
13312 @list='$(bin_PROGRAMS)'; for p in $$list; do \
13313 p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
13314 if test -f $$p \
13315@@ -248,14 +255,9 @@ uninstall-binPROGRAMS:
13316
13317 clean-binPROGRAMS:
13318 -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
13319-arith.h: arith.c
13320- @if test ! -f $@; then \
13321- rm -f arith.c; \
13322- $(MAKE) arith.c; \
13323- else :; fi
13324 dash$(EXEEXT): $(dash_OBJECTS) $(dash_DEPENDENCIES)
13325 @rm -f dash$(EXEEXT)
13326- $(LINK) $(dash_LDFLAGS) $(dash_OBJECTS) $(dash_LDADD) $(LIBS)
13327+ $(LINK) $(dash_OBJECTS) $(dash_LDADD) $(LIBS)
13328
13329 mostlyclean-compile:
13330 -rm -f *.$(OBJEXT)
13331@@ -264,7 +266,7 @@ distclean-compile:
13332 -rm -f *.tab.c
13333
13334 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alias.Po@am__quote@
13335-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arith.Po@am__quote@
13336+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arith_yacc.Po@am__quote@
13337 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arith_yylex.Po@am__quote@
13338 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cd.Po@am__quote@
13339 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/error.Po@am__quote@
13340@@ -292,85 +294,63 @@ distclean-compile:
13341 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/var.Po@am__quote@
13342
13343 .c.o:
13344-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
13345-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
13346+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
13347+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
13348 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
13349 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
13350 @am__fastdepCC_FALSE@ $(COMPILE) -c $<
13351
13352 .c.obj:
13353-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
13354-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
13355+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
13356+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
13357 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
13358 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
13359 @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
13360
13361 printf.o: bltin/printf.c
13362-@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT printf.o -MD -MP -MF "$(DEPDIR)/printf.Tpo" -c -o printf.o `test -f 'bltin/printf.c' || echo '$(srcdir)/'`bltin/printf.c; \
13363-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/printf.Tpo" "$(DEPDIR)/printf.Po"; else rm -f "$(DEPDIR)/printf.Tpo"; exit 1; fi
13364+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT printf.o -MD -MP -MF $(DEPDIR)/printf.Tpo -c -o printf.o `test -f 'bltin/printf.c' || echo '$(srcdir)/'`bltin/printf.c
13365+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/printf.Tpo $(DEPDIR)/printf.Po
13366 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bltin/printf.c' object='printf.o' libtool=no @AMDEPBACKSLASH@
13367 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
13368 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o printf.o `test -f 'bltin/printf.c' || echo '$(srcdir)/'`bltin/printf.c
13369
13370 printf.obj: bltin/printf.c
13371-@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT printf.obj -MD -MP -MF "$(DEPDIR)/printf.Tpo" -c -o printf.obj `if test -f 'bltin/printf.c'; then $(CYGPATH_W) 'bltin/printf.c'; else $(CYGPATH_W) '$(srcdir)/bltin/printf.c'; fi`; \
13372-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/printf.Tpo" "$(DEPDIR)/printf.Po"; else rm -f "$(DEPDIR)/printf.Tpo"; exit 1; fi
13373+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT printf.obj -MD -MP -MF $(DEPDIR)/printf.Tpo -c -o printf.obj `if test -f 'bltin/printf.c'; then $(CYGPATH_W) 'bltin/printf.c'; else $(CYGPATH_W) '$(srcdir)/bltin/printf.c'; fi`
13374+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/printf.Tpo $(DEPDIR)/printf.Po
13375 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bltin/printf.c' object='printf.obj' libtool=no @AMDEPBACKSLASH@
13376 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
13377 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o printf.obj `if test -f 'bltin/printf.c'; then $(CYGPATH_W) 'bltin/printf.c'; else $(CYGPATH_W) '$(srcdir)/bltin/printf.c'; fi`
13378
13379 test.o: bltin/test.c
13380-@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test.o -MD -MP -MF "$(DEPDIR)/test.Tpo" -c -o test.o `test -f 'bltin/test.c' || echo '$(srcdir)/'`bltin/test.c; \
13381-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test.Tpo" "$(DEPDIR)/test.Po"; else rm -f "$(DEPDIR)/test.Tpo"; exit 1; fi
13382+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test.o -MD -MP -MF $(DEPDIR)/test.Tpo -c -o test.o `test -f 'bltin/test.c' || echo '$(srcdir)/'`bltin/test.c
13383+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test.Tpo $(DEPDIR)/test.Po
13384 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bltin/test.c' object='test.o' libtool=no @AMDEPBACKSLASH@
13385 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
13386 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test.o `test -f 'bltin/test.c' || echo '$(srcdir)/'`bltin/test.c
13387
13388 test.obj: bltin/test.c
13389-@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test.obj -MD -MP -MF "$(DEPDIR)/test.Tpo" -c -o test.obj `if test -f 'bltin/test.c'; then $(CYGPATH_W) 'bltin/test.c'; else $(CYGPATH_W) '$(srcdir)/bltin/test.c'; fi`; \
13390-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/test.Tpo" "$(DEPDIR)/test.Po"; else rm -f "$(DEPDIR)/test.Tpo"; exit 1; fi
13391+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test.obj -MD -MP -MF $(DEPDIR)/test.Tpo -c -o test.obj `if test -f 'bltin/test.c'; then $(CYGPATH_W) 'bltin/test.c'; else $(CYGPATH_W) '$(srcdir)/bltin/test.c'; fi`
13392+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/test.Tpo $(DEPDIR)/test.Po
13393 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bltin/test.c' object='test.obj' libtool=no @AMDEPBACKSLASH@
13394 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
13395 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test.obj `if test -f 'bltin/test.c'; then $(CYGPATH_W) 'bltin/test.c'; else $(CYGPATH_W) '$(srcdir)/bltin/test.c'; fi`
13396
13397 times.o: bltin/times.c
13398-@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT times.o -MD -MP -MF "$(DEPDIR)/times.Tpo" -c -o times.o `test -f 'bltin/times.c' || echo '$(srcdir)/'`bltin/times.c; \
13399-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/times.Tpo" "$(DEPDIR)/times.Po"; else rm -f "$(DEPDIR)/times.Tpo"; exit 1; fi
13400+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT times.o -MD -MP -MF $(DEPDIR)/times.Tpo -c -o times.o `test -f 'bltin/times.c' || echo '$(srcdir)/'`bltin/times.c
13401+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/times.Tpo $(DEPDIR)/times.Po
13402 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bltin/times.c' object='times.o' libtool=no @AMDEPBACKSLASH@
13403 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
13404 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o times.o `test -f 'bltin/times.c' || echo '$(srcdir)/'`bltin/times.c
13405
13406 times.obj: bltin/times.c
13407-@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT times.obj -MD -MP -MF "$(DEPDIR)/times.Tpo" -c -o times.obj `if test -f 'bltin/times.c'; then $(CYGPATH_W) 'bltin/times.c'; else $(CYGPATH_W) '$(srcdir)/bltin/times.c'; fi`; \
13408-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/times.Tpo" "$(DEPDIR)/times.Po"; else rm -f "$(DEPDIR)/times.Tpo"; exit 1; fi
13409+@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT times.obj -MD -MP -MF $(DEPDIR)/times.Tpo -c -o times.obj `if test -f 'bltin/times.c'; then $(CYGPATH_W) 'bltin/times.c'; else $(CYGPATH_W) '$(srcdir)/bltin/times.c'; fi`
13410+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/times.Tpo $(DEPDIR)/times.Po
13411 @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='bltin/times.c' object='times.obj' libtool=no @AMDEPBACKSLASH@
13412 @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
13413 @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o times.obj `if test -f 'bltin/times.c'; then $(CYGPATH_W) 'bltin/times.c'; else $(CYGPATH_W) '$(srcdir)/bltin/times.c'; fi`
13414-
13415-.y.c:
13416- $(YACCCOMPILE) $<
13417- if test -f y.tab.h; then \
13418- to=`echo "$*_H" | sed \
13419- -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \
13420- -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g'`; \
13421- sed -e "/^#/!b" -e "s/Y_TAB_H/$$to/g" -e "s|y\.tab\.h|$*.h|" \
13422- y.tab.h >$*.ht; \
13423- rm -f y.tab.h; \
13424- if cmp -s $*.ht $*.h; then \
13425- rm -f $*.ht ;\
13426- else \
13427- mv $*.ht $*.h; \
13428- fi; \
13429- fi
13430- if test -f y.output; then \
13431- mv y.output $*.output; \
13432- fi
13433- sed '/^#/ s|y\.tab\.c|$@|' y.tab.c >$@t && mv $@t $@
13434- rm -f y.tab.c
13435-uninstall-info-am:
13436 install-man1: $(man1_MANS) $(man_MANS)
13437 @$(NORMAL_INSTALL)
13438- test -z "$(man1dir)" || $(mkdir_p) "$(DESTDIR)$(man1dir)"
13439+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
13440 @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
13441 l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
13442 for i in $$l2; do \
13443@@ -463,22 +443,21 @@ distclean-tags:
13444 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
13445
13446 distdir: $(DISTFILES)
13447- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
13448- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
13449- list='$(DISTFILES)'; for file in $$list; do \
13450- case $$file in \
13451- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
13452- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
13453- esac; \
13454+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
13455+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
13456+ list='$(DISTFILES)'; \
13457+ dist_files=`for file in $$list; do echo $$file; done | \
13458+ sed -e "s|^$$srcdirstrip/||;t" \
13459+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
13460+ case $$dist_files in \
13461+ */*) $(MKDIR_P) `echo "$$dist_files" | \
13462+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
13463+ sort -u` ;; \
13464+ esac; \
13465+ for file in $$dist_files; do \
13466 if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
13467- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
13468- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
13469- dir="/$$dir"; \
13470- $(mkdir_p) "$(distdir)$$dir"; \
13471- else \
13472- dir=''; \
13473- fi; \
13474 if test -d $$d/$$file; then \
13475+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
13476 if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
13477 cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
13478 fi; \
13479@@ -495,7 +474,7 @@ check: $(BUILT_SOURCES)
13480 all-am: Makefile $(PROGRAMS) $(MANS)
13481 installdirs:
13482 for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \
13483- test -z "$$dir" || $(mkdir_p) "$$dir"; \
13484+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
13485 done
13486 install: $(BUILT_SOURCES)
13487 $(MAKE) $(AM_MAKEFLAGS) install-am
13488@@ -523,8 +502,6 @@ distclean-generic:
13489 maintainer-clean-generic:
13490 @echo "This command is intended for maintainers to use"
13491 @echo "it deletes files that may require special tools to rebuild."
13492- -rm -f arith.c
13493- -rm -f arith.h
13494 -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES)
13495 clean: clean-am
13496
13497@@ -548,12 +525,20 @@ info-am:
13498
13499 install-data-am: install-man
13500
13501+install-dvi: install-dvi-am
13502+
13503 install-exec-am: install-binPROGRAMS
13504
13505+install-html: install-html-am
13506+
13507 install-info: install-info-am
13508
13509 install-man: install-man1
13510
13511+install-pdf: install-pdf-am
13512+
13513+install-ps: install-ps-am
13514+
13515 installcheck-am:
13516
13517 maintainer-clean: maintainer-clean-am
13518@@ -573,21 +558,25 @@ ps: ps-am
13519
13520 ps-am:
13521
13522-uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-man
13523+uninstall-am: uninstall-binPROGRAMS uninstall-man
13524
13525 uninstall-man: uninstall-man1
13526
13527+.MAKE: install-am install-strip
13528+
13529 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
13530 clean-generic ctags distclean distclean-compile \
13531 distclean-generic distclean-tags distdir dvi dvi-am html \
13532 html-am info info-am install install-am install-binPROGRAMS \
13533- install-data install-data-am install-exec install-exec-am \
13534+ install-data install-data-am install-dvi install-dvi-am \
13535+ install-exec install-exec-am install-html install-html-am \
13536 install-info install-info-am install-man install-man1 \
13537+ install-pdf install-pdf-am install-ps install-ps-am \
13538 install-strip installcheck installcheck-am installdirs \
13539 maintainer-clean maintainer-clean-generic mostlyclean \
13540 mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
13541 tags uninstall uninstall-am uninstall-binPROGRAMS \
13542- uninstall-info-am uninstall-man uninstall-man1
13543+ uninstall-man uninstall-man1
13544
13545
13546 token.h: mktokens
13547--
135481.5.5
13549
13550From faf3a201e33ee8012c1f3e19bc249f9307924cf1 Mon Sep 17 00:00:00 2001
13551From: Larry Doolittle <ldoolitt@recycle.lbl.gov>
13552Date: Sun, 2 Mar 2008 21:14:35 +0000
13553Subject: [PATCH] Fix null pointer dereference
13554
13555This is a real bug in upstream dash, which has existed since at
13556least dash-0.5.1 (July 2004). It is a latent bug in cmdtxt()
13557(which I think applies only to pipes) as it handles "if" commands.
13558The attached patch fixes it for me.
13559
13560Test case:
13561
13562 dash -ic 'if true; then for x in foo; do echo bar; done; fi | cat'
13563---
13564 src/jobs.c | 5 +++--
13565 1 files changed, 3 insertions(+), 2 deletions(-)
13566
13567diff --git a/src/jobs.c b/src/jobs.c
13568index 529d615..40dc8f6 100644
13569--- a/src/jobs.c
13570+++ b/src/jobs.c
13571@@ -1235,11 +1235,12 @@ donode:
13572 cmdputs("if ");
13573 cmdtxt(n->nif.test);
13574 cmdputs("; then ");
13575- n = n->nif.ifpart;
13576 if (n->nif.elsepart) {
13577- cmdtxt(n);
13578+ cmdtxt(n->nif.ifpart);
13579 cmdputs("; else ");
13580 n = n->nif.elsepart;
13581+ } else {
13582+ n = n->nif.ifpart;
13583 }
13584 p = "; fi";
13585 goto dotail;
13586--
135871.5.5
13588
13589From b02cef8334c317394bab008475659693d8447244 Mon Sep 17 00:00:00 2001
13590From: Gerrit Pape <pape@smarden.org>
13591Date: Tue, 25 Mar 2008 19:44:45 +0000
13592Subject: [PATCH] Fix bitwise AND and OR operator parsing
13593
13594The parser used to skip a byte when parsing the & and | operators, testcase:
13595
13596 $ dash -c 'echo $((7&1))'
13597 $ dash -c 'echo $((7& 1))'
13598 $ dash -c 'echo $((7&11))'
13599---
13600 src/arith_yylex.c | 2 ++
13601 1 files changed, 2 insertions(+), 0 deletions(-)
13602
13603diff --git a/src/arith_yylex.c b/src/arith_yylex.c
13604index 2c15657..ef8e3e3 100644
13605--- a/src/arith_yylex.c
13606+++ b/src/arith_yylex.c
13607@@ -173,6 +173,7 @@ checkeq:
13608 case '|':
13609 if (*++buf != '|') {
13610 value += ARITH_BOR - '|';
13611+ --buf;
13612 goto checkeq;
13613 }
13614 value += ARITH_OR - '|';
13615@@ -180,6 +181,7 @@ checkeq:
13616 case '&':
13617 if (*++buf != '&') {
13618 value += ARITH_BAND - '&';
13619+ --buf;
13620 goto checkeq;
13621 }
13622 value += ARITH_AND - '&';
13623--
136241.5.5
13625
This page took 1.680081 seconds and 4 git commands to generate.