From 202623b7d65eca743c4e4979bfbb335d20b86cb0 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Thu, 13 Jul 2006 07:55:52 +0000 Subject: [PATCH] fix bootstrap process Patches applied: * bonzini@gnu.org--2004b/sed--stable--4.1--patch-68 robustify bootstrap process, ensure distribution of updated boostrap.sh git-archimport-id: bonzini@gnu.org--2004b/sed--ssed--3.61--patch-29 --- ChangeLog | 7 ++++- Makefile.am | 8 +++-- bootstrap.sh | 84 ++++++++++++++++++++++++++++++++++++++----------- bootstrap.sh.in | 82 ++++++++++++++++++++++++++++++++++++----------- pcre/pcre.h | 2 ++ 5 files changed, 143 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0189304..e4e3d3c 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 e639e26..d2c725e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -11,8 +11,7 @@ SUBDIRS = intl lib pcre 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 ae98d08..ebf7eab 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -19,7 +19,7 @@ if test -f config.h; then :; else */ #define PACKAGE "sed" -#define VERSION "3.61-boot" +#define VERSION "3.62-boot" #define SED_FEATURE_VERSION "4.1" #define BOOTSTRAP 1 @@ -35,17 +35,65 @@ 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 + + cat > conftest.c << \EOF +#include +int foo; + +EOF + if $CC -c conftest.c -o conftest.o > /dev/null 2>&1 ; then + echo checking for malloc.h... yes + echo '#define HAVE_MALLOC_H 1' >> config.h + echo '#undef STDC_HEADERS' >> config.h + else + echo checking for malloc.h... no + echo '#undef HAVE_MALLOC_H' >> config.h + echo '#define STDC_HEADERS 1' >> config.h + fi + + rm -f conftest.* fi # tell the user what we're doing from here on... @@ -55,8 +103,6 @@ set -x -e rm -f lib/*.o sed/*.o sed/sed cd lib || exit 1 -rm -f regex.h -cp regex_.h regex.h ${CC} -DHAVE_CONFIG_H -I.. -I. -c alloca.c ${CC} -DHAVE_CONFIG_H -I.. -I. -c getline.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -c getopt.c || exit 1 @@ -67,12 +113,12 @@ ${CC} -DHAVE_CONFIG_H -I.. -I. -c memmove.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -c mkstemp.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -c strverscmp.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -c obstack.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c regex.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -c strerror.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -c utils.c || exit 1 cd ../pcre || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regdebug.c || exit 1 +${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regexec.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regexp.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c reginfo.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regperl.c || exit 1 @@ -82,11 +128,11 @@ ${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regsub.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regtables.c || exit 1 cd ../sed || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c sed.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c fmt.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c compile.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c execute.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c mbcs.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regexp.c || exit 1 +${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -I ../pcre -c sed.c || exit 1 +${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -I ../pcre -c fmt.c || exit 1 +${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -I ../pcre -c compile.c || exit 1 +${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -I ../pcre -c execute.c || exit 1 +${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -I ../pcre -c mbcs.c || exit 1 +${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -I ../pcre -c regexp.c || exit 1 -${CC} -o sed *.o ../lib/*.o || exit 1 +${CC} -o sed *.o ../lib/*.o ../pcre/*.o || exit 1 diff --git a/bootstrap.sh.in b/bootstrap.sh.in index 5146490..5061cf6 100755 --- a/bootstrap.sh.in +++ b/bootstrap.sh.in @@ -35,17 +35,65 @@ 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 + + cat > conftest.c << \EOF +#include +int foo; + +EOF + if $CC -c conftest.c -o conftest.o > /dev/null 2>&1 ; then + echo checking for malloc.h... yes + echo '#define HAVE_MALLOC_H 1' >> config.h + echo '#undef STDC_HEADERS' >> config.h + else + echo checking for malloc.h... no + echo '#undef HAVE_MALLOC_H' >> config.h + echo '#define STDC_HEADERS 1' >> config.h + fi + + rm -f conftest.* fi # tell the user what we're doing from here on... @@ -55,8 +103,6 @@ set -x -e rm -f lib/*.o sed/*.o sed/sed cd lib || exit 1 -rm -f regex.h -cp regex_.h regex.h ${CC} -DHAVE_CONFIG_H -I.. -I. -c alloca.c ${CC} -DHAVE_CONFIG_H -I.. -I. -c getline.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -c getopt.c || exit 1 @@ -67,12 +113,12 @@ ${CC} -DHAVE_CONFIG_H -I.. -I. -c memmove.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -c mkstemp.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -c strverscmp.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -c obstack.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c regex.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -c strerror.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -c utils.c || exit 1 cd ../pcre || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regdebug.c || exit 1 +${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regexec.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regexp.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c reginfo.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regperl.c || exit 1 @@ -82,11 +128,11 @@ ${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regsub.c || exit 1 ${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regtables.c || exit 1 cd ../sed || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c sed.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c fmt.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c compile.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c execute.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c mbcs.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regexp.c || exit 1 +${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -I ../pcre -c sed.c || exit 1 +${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -I ../pcre -c fmt.c || exit 1 +${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -I ../pcre -c compile.c || exit 1 +${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -I ../pcre -c execute.c || exit 1 +${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -I ../pcre -c mbcs.c || exit 1 +${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -I ../pcre -c regexp.c || exit 1 -${CC} -o sed *.o ../lib/*.o || exit 1 +${CC} -o sed *.o ../lib/*.o ../pcre/*.o || exit 1 diff --git a/pcre/pcre.h b/pcre/pcre.h index 8860629..d260675 100644 --- a/pcre/pcre.h +++ b/pcre/pcre.h @@ -17,8 +17,10 @@ #include #endif #ifdef BOOTSTRAP +#ifdef HAVE_MALLOC_H #include #endif +#endif /* Allow for C++ users */