From ec9561cfa498794621c415005c196abd736f7587 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 13 Jul 2006 07:38:31 +0000 Subject: [PATCH] robustify bootstrap process, ensure distribution of updated boostrap.sh 2006-07-13 Paolo Bonzini * bootstrap.sh.in: Add a few autoconfy tests. * Makefile.am: Update distributed bootstrap.sh. git-archimport-id: bonzini@gnu.org--2004b/sed--stable--4.1--patch-68 --- ChangeLog | 7 +++++- Makefile.am | 8 +++++-- bootstrap.sh | 51 ++++++++++++++++++++++++++++++++++++-------- bootstrap.sh.in | 49 +++++++++++++++++++++++++++++++++++------- lib/regex_internal.h | 23 +++++++++++++++++++- 5 files changed, 117 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a663be..518fe07 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2006-05-15 Hans-Bernhard Bröker +2006-07-13 Paolo Bonzini + + * bootstrap.sh.in: Add a few autoconfy tests. + * Makefile.am: Update distributed bootstrap.sh. + +2006-05-15 Hans-Bernhard Broeker * sed/basicdefs.h (OB_MALLOC): Turn VCAST into void * cast. diff --git a/Makefile.am b/Makefile.am index a6ecc04..c773139 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,8 +11,7 @@ SUBDIRS = intl lib po sed doc testsuite noinst_DATA = bootstrap.sh noinst_HEADERS = basicdefs.h -EXTRA_DIST = BUGS THANKS COPYING.DOC README.boot bootstrap.sh \ - config/texi2dvi config/help2man +EXTRA_DIST = BUGS THANKS COPYING.DOC README.boot config/texi2dvi config/help2man html: cd doc && make html @@ -20,6 +19,11 @@ html: DISTCHECK_CONFIGURE_FLAGS = XGETTEXT='$(SHELL) -c : dummy' $(EXTRA_DC_FLAGS) EXTRA_DC_FLAGS = +dist-hook: + cmp bootstrap.sh $(srcdir)/bootstrap.sh > /dev/null 2>&1 || \ + cp -p bootstrap.sh $(srcdir)/bootstrap.sh + cp -p $(srcdir)/bootstrap.sh $(distdir)/bootstrap.sh + full-distcheck: make distcheck EXTRA_DC_FLAGS='--enable-html' make distcheck EXTRA_DC_FLAGS='--disable-i18n' diff --git a/bootstrap.sh b/bootstrap.sh index 1c5977b..a88272f 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -19,7 +19,7 @@ if test -f config.h; then :; else */ #define PACKAGE "sed" -#define VERSION "4.1.2-boot" +#define VERSION "4.1.5-boot" #define SED_FEATURE_VERSION "4.1" #define BOOTSTRAP 1 @@ -35,17 +35,50 @@ if test -f config.h; then :; else #undef HAVE_SYS_FILE_H #undef HAVE_IO_H -/* Undefine if or has conflicting definition. */ -#define size_t unsigned -#define ssize_t int - -/* If your antique compiler doesn't grok ``void *'', then #define VOID char */ -#undef VOID - - /* All other config.h.in options intentionally omitted. Report as a bug if you need extra "#define"s in here. */ END_OF_CONFIG_H + + cat > conftest.c << \EOF +#define size_t unsigned +#include +#include + +size_t s; +EOF + if $CC -c conftest.c -o conftest.o > /dev/null 2>&1 ; then + echo '#define size_t unsigned' >> config.h + echo checking for size_t... no + else + echo checking for size_t... yes + fi + + cat > conftest.c << \EOF +#define ssize_t int +#include +#include + +ssize_t s; +EOF + if $CC -c conftest.c -o conftest.o > /dev/null 2>&1 ; then + echo '#define ssize_t int' >> config.h + echo checking for ssize_t... no + else + echo checking for ssize_t... yes + fi + + cat > conftest.c << \EOF +void *foo; + +EOF + if $CC -c conftest.c -o conftest.o > /dev/null 2>&1 ; then + echo checking for void *... yes + else + echo '#define VOID char' >> config.h + echo checking for void *... no + fi + + rm -f conftest.* fi # tell the user what we're doing from here on... diff --git a/bootstrap.sh.in b/bootstrap.sh.in index 82b2432..1a1a2b3 100755 --- a/bootstrap.sh.in +++ b/bootstrap.sh.in @@ -35,17 +35,50 @@ if test -f config.h; then :; else #undef HAVE_SYS_FILE_H #undef HAVE_IO_H -/* Undefine if or has conflicting definition. */ -#define size_t unsigned -#define ssize_t int - -/* If your antique compiler doesn't grok ``void *'', then #define VOID char */ -#undef VOID - - /* All other config.h.in options intentionally omitted. Report as a bug if you need extra "#define"s in here. */ END_OF_CONFIG_H + + cat > conftest.c << \EOF +#define size_t unsigned +#include +#include + +size_t s; +EOF + if $CC -c conftest.c -o conftest.o > /dev/null 2>&1 ; then + echo '#define size_t unsigned' >> config.h + echo checking for size_t... no + else + echo checking for size_t... yes + fi + + cat > conftest.c << \EOF +#define ssize_t int +#include +#include + +ssize_t s; +EOF + if $CC -c conftest.c -o conftest.o > /dev/null 2>&1 ; then + echo '#define ssize_t int' >> config.h + echo checking for ssize_t... no + else + echo checking for ssize_t... yes + fi + + cat > conftest.c << \EOF +void *foo; + +EOF + if $CC -c conftest.c -o conftest.o > /dev/null 2>&1 ; then + echo checking for void *... yes + else + echo '#define VOID char' >> config.h + echo checking for void *... no + fi + + rm -f conftest.* fi # tell the user what we're doing from here on... diff --git a/lib/regex_internal.h b/lib/regex_internal.h index f22c13c..53282d8 100644 --- a/lib/regex_internal.h +++ b/lib/regex_internal.h @@ -41,6 +41,8 @@ #endif /* HAVE_WCTYPE_H || _LIBC */ #if defined HAVE_STDBOOL_H || defined _LIBC # include +#else +# define bool char #endif /* HAVE_STDBOOL_H || _LIBC */ #if defined _LIBC # include @@ -410,7 +412,26 @@ static unsigned int re_string_context_at (const re_string_t *input, int idx, #define re_string_skip_bytes(pstr,idx) ((pstr)->cur_idx += (idx)) #define re_string_set_index(pstr,idx) ((pstr)->cur_idx = (idx)) -#include +#ifndef alloca /* predefined by HP cc +Olibcalls */ +# ifdef __GNUC__ +# define alloca(size) __builtin_alloca(size) +# else +# if HAVE_ALLOCA_H +# include +# else +# if defined(__hpux) +void *alloca (); +# else +# if !defined(__OS2__) && !defined(WIN32) +char *alloca (); +# else +# include /* OS/2 defines alloca in here */ +# endif +# endif +# endif +# endif +#endif + #ifndef _LIBC # if HAVE_ALLOCA