summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2009-04-27 10:29:02 +0200
committerPaolo Bonzini <bonzini@gnu.org>2009-04-27 10:41:56 +0200
commit81721849897d4285de9f34e98cd447c091e44e3d (patch)
tree8fcaa7b3e9138f06b29d5084a30dbe591923cdd5
parent9e971bab122eb52eb74382e3ce86e9e6ad6e5cbc (diff)
downloadsed-81721849897d4285de9f34e98cd447c091e44e3d.tar.gz
fixes after Bruno's testing
2009-04-27 Paolo Bonzini <bonzini@gnu.org> * configure.ac: Link readin.in2 into builddir. * configure: Regenerate. * doc/Makefile.am: Do not distribute sed.html. Do not update sed.texi if the output does not change. * sed/Makefile.am: Order libraries according to their dependencies. * sed/compile.c (get_openfile): Declare FAIL as int. * sed/sed.c: Avoid printf ("") if REG_PERL is not defined. * testsuite/eval.in2: Do not include in the repository. * testsuite/Makefile.am: Clean always eval.in2 and never readin.in2. * testsuite/Makefile.tests: Provide a default empty definition of TIME and remove rules for readin.in2.
-rw-r--r--ChangeLog14
-rw-r--r--configure.ac3
-rw-r--r--doc/Makefile.am14
-rw-r--r--doc/s-texi1
-rw-r--r--sed/Makefile.am2
-rw-r--r--sed/compile.c4
-rw-r--r--sed/sed.c2
-rw-r--r--sed/utils.c24
-rw-r--r--testsuite/Makefile.am5
-rw-r--r--testsuite/Makefile.tests7
-rw-r--r--testsuite/eval.in25
11 files changed, 44 insertions, 37 deletions
diff --git a/ChangeLog b/ChangeLog
index 287c173..ed4cb16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2009-04-27 Paolo Bonzini <bonzini@gnu.org>
+
+ * configure.ac: Link readin.in2 into builddir.
+ * configure: Regenerate.
+ * doc/Makefile.am: Do not distribute sed.html. Do not update
+ sed.texi if the output does not change.
+ * sed/Makefile.am: Order libraries according to their dependencies.
+ * sed/compile.c (get_openfile): Declare FAIL as int.
+ * sed/sed.c: Avoid printf ("") if REG_PERL is not defined.
+ * testsuite/eval.in2: Do not include in the repository.
+ * testsuite/Makefile.am: Clean always eval.in2 and never readin.in2.
+ * testsuite/Makefile.tests: Provide a default empty definition of TIME
+ and remove rules for readin.in2.
+
2009-03-31 Paolo Bonzini <bonzini@gnu.org>
* bootstrap.sh.in: Add __bool_true_false_are_defined.
diff --git a/configure.ac b/configure.ac
index 5abdaa9..cd27cf9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,6 +83,9 @@ if test "x$have_lstat" = xyes -a "x$have_readlink" = xyes; then
AC_DEFINE(ENABLE_FOLLOW_SYMLINKS, ,[Follow symlinks when processing in place])
fi
+if test "$srcdir" != .; then
+ AC_CONFIG_LINKS([testsuite/readin.in2:testsuite/readin.in2])
+fi
AC_CONFIG_FILES([bootstrap.sh], chmod +x bootstrap.sh)
AC_CONFIG_FILES([testsuite/version.good:testsuite/version.gin])
AC_CONFIG_FILES([Makefile doc/Makefile \
diff --git a/doc/Makefile.am b/doc/Makefile.am
index bd29508..af6975c 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -2,9 +2,8 @@
info_TEXINFOS = sed.texi
sed_TEXINFOS = config.texi version.texi
dist_man_MANS = sed.1
-dist_noinst_DATA = sed.x sed-in.texi
+dist_noinst_DATA = sed.x sed-in.texi s-texi
dist_noinst_SCRIPTS = groupify.sed
-dist_doc_DATA = sed.html
TEXI2DVI = $(top_srcdir)/build-aux/texi2dvi --expand
HELP2MAN = $(top_srcdir)/build-aux/help2man
SED = $(top_builddir)/sed/sed
@@ -15,9 +14,16 @@ AM_MAKEINFOHTMLFLAGS = --no-split
# scripts we group comments with lines following them;
# since mantaining the "@group...@end group" manually
# is a burden, we do this automatically
-$(srcdir)/sed.texi: sed-in.texi $(srcdir)/groupify.sed
+$(srcdir)/sed.texi: $(srcdir)/s-texi
+$(srcdir)/s-texi: sed-in.texi $(srcdir)/groupify.sed
sed -nf $(srcdir)/groupify.sed \
- < $(srcdir)/sed-in.texi > $(srcdir)/sed.texi
+ < $(srcdir)/sed-in.texi > $(srcdir)/sed-tmp.texi
+ if cmp $(srcdir)/sed.texi $(srcdir)/sed-tmp.texi; then \
+ rm -f $(srcdir)/sed-tmp.texi; \
+ else \
+ mv -f $(srcdir)/sed-tmp.texi $(srcdir)/sed.texi; \
+ fi
+ echo stamp > $(srcdir)/s-texi
sed.1: $(top_srcdir)/sed/sed.c $(top_srcdir)/configure.ac $(srcdir)/sed.x
$(HELP2MAN) --name "stream editor for filtering and transforming text" \
diff --git a/doc/s-texi b/doc/s-texi
new file mode 100644
index 0000000..859afb1
--- /dev/null
+++ b/doc/s-texi
@@ -0,0 +1 @@
+stamp
diff --git a/sed/Makefile.am b/sed/Makefile.am
index cfa7ed3..93979d3 100644
--- a/sed/Makefile.am
+++ b/sed/Makefile.am
@@ -9,7 +9,7 @@ noinst_HEADERS = sed.h utils.h
AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir) -I$(top_builddir)/lib \
-DLOCALEDIR=\"$(localedir)\"
-sed_LDADD = @INTLLIBS@ @LIB_ACL@ ../lib/libsed.a
+sed_LDADD = ../lib/libsed.a @INTLLIBS@ @LIB_ACL@
sed_DEPENDENCIES = ../lib/libsed.a
$(PROGRAMS): $(LDADD)
diff --git a/sed/compile.c b/sed/compile.c
index f5d51fd..e0a47a8 100644
--- a/sed/compile.c
+++ b/sed/compile.c
@@ -373,12 +373,12 @@ read_filename()
return b;
}
-static struct output *get_openfile P_((struct output **file_ptrs, const char *mode, bool fail));
+static struct output *get_openfile P_((struct output **file_ptrs, const char *mode, int fail));
static struct output *
get_openfile(file_ptrs, mode, fail)
struct output **file_ptrs;
const char *mode;
- bool fail;
+ int fail;
{
struct buffer *b;
char *file_name;
diff --git a/sed/sed.c b/sed/sed.c
index 903f18c..bab2296 100644
--- a/sed/sed.c
+++ b/sed/sed.c
@@ -147,7 +147,9 @@ Usage: %s [OPTION]... {script-only-if-no-other-script} [input-file]...\n\
disable all GNU extensions.\n"));
fprintf(out, _(" -r, --regexp-extended\n\
use extended regular expressions in the script.\n"));
+#ifdef REG_PERL
fprintf(out, PERL_HELP);
+#endif
fprintf(out, _(" -s, --separate\n\
consider files as separate rather than as a single continuous\n\
long stream.\n"));
diff --git a/sed/utils.c b/sed/utils.c
index 78ae01c..94c4644 100644
--- a/sed/utils.c
+++ b/sed/utils.c
@@ -19,7 +19,7 @@
#include "config.h"
#include <stdio.h>
-
+#include <stdarg.h>
#include <errno.h>
#ifndef errno
extern int errno;
@@ -61,34 +61,24 @@ static struct open_file *open_files = NULL;
static void do_ck_fclose P_((FILE *fp));
/* Print an error message and exit */
-#if !defined __STDC__ || !(__STDC__-0)
-# include <varargs.h>
-# define VSTART(l,a) va_start(l)
-void
-panic(str, va_alist)
- char *str;
- va_dcl
-#else /*__STDC__*/
-# include <stdarg.h>
-# define VSTART(l,a) va_start(l, a)
+
void
panic(const char *str, ...)
-#endif /* __STDC__ */
{
- va_list iggy;
+ va_list ap;
fprintf(stderr, "%s: ", myname);
- VSTART(iggy, str);
+ va_start(ap, str);
#ifndef HAVE_VPRINTF
# ifndef HAVE_DOPRNT
fputs(str, stderr); /* not great, but perhaps better than nothing... */
# else /* HAVE_DOPRNT */
- _doprnt(str, &iggy, stderr);
+ _doprnt(str, &ap, stderr);
# endif /* HAVE_DOPRNT */
#else /* HAVE_VFPRINTF */
- vfprintf(stderr, str, iggy);
+ vfprintf(stderr, str, ap);
#endif /* HAVE_VFPRINTF */
- va_end(iggy);
+ va_end(ap);
putc('\n', stderr);
/* Unlink the temporary files. */
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index bbf1446..96db88f 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -1,4 +1,4 @@
-CLEANFILES = tmp* core *.core $(EXTRA_PROGRAMS) *.*out *.log
+CLEANFILES = tmp* core *.core $(EXTRA_PROGRAMS) *.*out *.log eval.in2
TESTS = $(check_PROGRAMS) $(SEDTESTS)
SEDTESTS =
@@ -94,9 +94,6 @@ EXTRA_DIST = \
y-bracket.good y-bracket.sed y-bracket.inp \
y-newline.good y-newline.sed y-newline.inp
-clean-local:
- test x$(srcdir) = x. || rm -f readin.in2 eval.in2
-
# automake makes `check' depend on $(TESTS). Declare
# dummy targets for $(TESTS) so that make does not complain.
diff --git a/testsuite/Makefile.tests b/testsuite/Makefile.tests
index 0c83daf..7f1f118 100644
--- a/testsuite/Makefile.tests
+++ b/testsuite/Makefile.tests
@@ -8,6 +8,8 @@ SED = ../sed/sed
SEDENV = LC_ALL=C $(TIME)
#TIME=time
+TIME=
+
CMP=cmp
RM=rm -f
@@ -110,10 +112,7 @@ writeout::
$(CMP) $(srcdir)/wrtout2.good $@.wout
@$(RM) $@.1out $@.wout
-readin.in2: $(srcdir)/readin.in2
- cat $(srcdir)/readin.in2 > $@
-
-readin:: readin.in2
+readin::
$(SEDENV) $(SED) -f $(srcdir)/$@.sed < $(srcdir)/$@.inp >$@.out
$(CMP) $(srcdir)/$@.good $@.out
@$(RM) $@.out
diff --git a/testsuite/eval.in2 b/testsuite/eval.in2
deleted file mode 100644
index 4e30989..0000000
--- a/testsuite/eval.in2
+++ /dev/null
@@ -1,5 +0,0 @@
-17380: 2 2 5 11 79
-abcd
-cpu
- abcd
- cpu