From 69b257e52cbca7e6b10b860201a54b677fe55da0 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 16 Mar 2012 08:53:39 +0100 Subject: [PATCH] remove bootstrap script 2012-03-16 Paolo Bonzini * bootstrap.sh.in: Remove. * bootstrap.sh: Remove. * configure.ac: Do not create bootstrap.sh. * basicdefs.h [BOOTSTRAP]: Remove guards. * pcre/pcre.h [BOOTSTRAP]: Remove guards. * sed/execute.c [BOOTSTRAP]: Remove guards. * sed/sed.c [BOOTSTRAP]: Remove guards. * sed/sed.h [BOOTSTRAP]: Remove guards. --- ChangeLog | 11 +++ basicdefs.h | 9 +-- bootstrap.sh | 176 ------------------------------------------------ bootstrap.sh.in | 176 ------------------------------------------------ configure.ac | 1 - pcre/pcre.h | 5 -- sed/execute.c | 41 +---------- sed/sed.c | 2 - sed/sed.h | 3 - 9 files changed, 13 insertions(+), 411 deletions(-) delete mode 100755 bootstrap.sh delete mode 100755 bootstrap.sh.in diff --git a/ChangeLog b/ChangeLog index 424f4ca..3e8b26c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2012-03-16 Paolo Bonzini + + * bootstrap.sh.in: Remove. + * bootstrap.sh: Remove. + * configure.ac: Do not create bootstrap.sh. + * basicdefs.h: Remove guards. + * pcre/pcre.h [BOOTSTRAP]: Remove guards. + * sed/execute.c [BOOTSTRAP]: Remove guards. + * sed/sed.c [BOOTSTRAP]: Remove guards. + * sed/sed.h [BOOTSTRAP]: Remove guards. + 2012-03-16 Paolo Bonzini * execute.c (open_next_file): Save/restore file creation context. diff --git a/basicdefs.h b/basicdefs.h index 287631a..3d44cff 100644 --- a/basicdefs.h +++ b/basicdefs.h @@ -31,14 +31,7 @@ #endif -#ifdef BOOTSTRAP -# define false 0 -# define true 1 -# define bool unsigned -# define __bool_true_false_are_defined 1 -#else -# include -#endif +#include #include #define N_(String) gettext_noop(String) diff --git a/bootstrap.sh b/bootstrap.sh deleted file mode 100755 index c516378..0000000 --- a/bootstrap.sh +++ /dev/null @@ -1,176 +0,0 @@ -#! /bin/sh - -# edit this to taste; note that you can also override via the environment: -case "$CC" in - "") CC=cc -esac - -if test -f config.h; then :; else - echo "Creating basic config.h..." - cat >config.h <<'END_OF_CONFIG_H' -/* A bootstrap version of config.h, for systems which can't - auto-configure due to a lack of a working sed. If you are on - a sufficiently odd machine you may need to hand-tweak this file. - - Regardless, once you get a working version of sed you really should - re-build starting with a run of "configure", as the bootstrap - version is almost certainly more crippled than it needs to be on - your machine. -*/ - -#define PACKAGE "sed" -#define PACKAGE_BUGREPORT "bonzini@gnu.org" -#define VERSION "3.63-boot" -#define SED_FEATURE_VERSION "4.2" -#define BOOTSTRAP 1 - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif - -/* Define if your compiler/headers don't support const. */ -#undef const -#define __getopt_argv_const const - -/* Define if headers have no definition. */ -/* #define mbstate_t int */ -#define HAVE_WCHAR_H 1 -#define HAVE_MBRTOWC 1 - -/* Toggle if you encounter errors in lib/mkstemp.c. */ -#define HAVE_UNISTD_H 1 -#define HAVE_FCNTL_H 1 -#undef HAVE_SYS_FILE_H -#undef HAVE_IO_H - -/* Emulate stdbool.h. */ -#define bool int -#define true 1 -#define false 0 - -/* Avoid uselessly complicated gnulib stuff. */ -#define _LOCALCHARSET_H -#define locale_charset() "C" - -/* 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.* - - cat >> config.h << \EOF -#include -#include -EOF - -fi - -# tell the user what we're doing from here on... -set -x -e - -# the ``|| exit 1''s are for fail-stop; set -e doesn't work on some systems - -rm -f lib/*.o sed/*.o sed/sed -cd lib || exit 1 -cp alloca.in.h alloca.h || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c alloca.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c copy-acl.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c error.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c exitfail.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c file-has-acl.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c getdelim.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c getline.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c getopt.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c getopt1.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c malloc.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c mkstemp.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c obstack.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c quote.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c quotearg.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c printf-args.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c printf-parse.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c snprintf.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c set-mode-acl.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c strerror.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c strverscmp.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c tempname.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c vasnprintf.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c xalloc-die.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c xmalloc.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 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regposix.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regstudy.c || exit 1 -${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 -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} -DHAVE_CONFIG_H -I.. -I. -I../lib -I ../pcre -c utils.c || exit 1 - -${CC} -o sed *.o ../lib/*.o ../pcre/*.o || exit 1 diff --git a/bootstrap.sh.in b/bootstrap.sh.in deleted file mode 100755 index a2f3b78..0000000 --- a/bootstrap.sh.in +++ /dev/null @@ -1,176 +0,0 @@ -#! /bin/sh - -# edit this to taste; note that you can also override via the environment: -case "$CC" in - "") CC=cc -esac - -if test -f config.h; then :; else - echo "Creating basic config.h..." - cat >config.h <<'END_OF_CONFIG_H' -/* A bootstrap version of config.h, for systems which can't - auto-configure due to a lack of a working sed. If you are on - a sufficiently odd machine you may need to hand-tweak this file. - - Regardless, once you get a working version of sed you really should - re-build starting with a run of "configure", as the bootstrap - version is almost certainly more crippled than it needs to be on - your machine. -*/ - -#define PACKAGE "sed" -#define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" -#define VERSION "@VERSION@-boot" -#define SED_FEATURE_VERSION "@SED_FEATURE_VERSION@" -#define BOOTSTRAP 1 - -#ifndef _GNU_SOURCE -#define _GNU_SOURCE 1 -#endif - -/* Define if your compiler/headers don't support const. */ -#undef const -#define __getopt_argv_const const - -/* Define if headers have no definition. */ -/* #define mbstate_t int */ -#define HAVE_WCHAR_H 1 -#define HAVE_MBRTOWC 1 - -/* Toggle if you encounter errors in lib/mkstemp.c. */ -#define HAVE_UNISTD_H 1 -#define HAVE_FCNTL_H 1 -#undef HAVE_SYS_FILE_H -#undef HAVE_IO_H - -/* Emulate stdbool.h. */ -#define bool int -#define true 1 -#define false 0 - -/* Avoid uselessly complicated gnulib stuff. */ -#define _LOCALCHARSET_H -#define locale_charset() "C" - -/* 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.* - - cat >> config.h << \EOF -#include -#include -EOF - -fi - -# tell the user what we're doing from here on... -set -x -e - -# the ``|| exit 1''s are for fail-stop; set -e doesn't work on some systems - -rm -f lib/*.o sed/*.o sed/sed -cd lib || exit 1 -cp alloca.in.h alloca.h || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c alloca.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c copy-acl.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c error.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c exitfail.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c file-has-acl.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c getdelim.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c getline.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c getopt.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c getopt1.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c malloc.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c mkostemp.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c obstack.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c quote.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c quotearg.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c printf-args.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c printf-parse.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c snprintf.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c set-mode-acl.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c strerror.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c strverscmp.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c tempname.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c vasnprintf.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c xalloc-die.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -c xmalloc.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 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regposix.c || exit 1 -${CC} -DHAVE_CONFIG_H -I.. -I. -I../lib -c regstudy.c || exit 1 -${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 -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} -DHAVE_CONFIG_H -I.. -I. -I../lib -I ../pcre -c utils.c || exit 1 - -${CC} -o sed *.o ../lib/*.o ../pcre/*.o || exit 1 diff --git a/configure.ac b/configure.ac index bd4a305..56e9a63 100644 --- a/configure.ac +++ b/configure.ac @@ -91,7 +91,6 @@ case $host in esac AC_SUBST([XFAIL_TESTS]) -AC_CONFIG_FILES([bootstrap.sh], chmod +x bootstrap.sh) AC_CONFIG_FILES([testsuite/version.good:testsuite/version.gin]) AC_CONFIG_FILES([Makefile doc/Makefile \ lib/Makefile sed/Makefile testsuite/Makefile \ diff --git a/pcre/pcre.h b/pcre/pcre.h index d260675..4a9a9c3 100644 --- a/pcre/pcre.h +++ b/pcre/pcre.h @@ -16,11 +16,6 @@ #ifdef STDC_HEADERS #include #endif -#ifdef BOOTSTRAP -#ifdef HAVE_MALLOC_H -#include -#endif -#endif /* Allow for C++ users */ diff --git a/sed/execute.c b/sed/execute.c index 9367a34..4b044c4 100644 --- a/sed/execute.c +++ b/sed/execute.c @@ -31,19 +31,14 @@ extern int errno; #endif -#ifndef BOOTSTRAP #include #include -#endif +#include "acl.h" #ifdef HAVE_UNISTD_H # include #endif -#ifndef BOOTSTRAP -#include "acl.h" -#endif - #ifdef __GNUC__ # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__-0 >= 7) /* silence warning about unused parameter even for "gcc -W -Wunused" */ @@ -171,34 +166,6 @@ static struct append_queue *append_head = NULL; static struct append_queue *append_tail = NULL; -#ifdef BOOTSTRAP -/* We can't be sure that the system we're boostrapping on has - memchr(), and ../lib/memchr.c requires configuration knowledge - about how many bits are in a `long'. This implementation - is far from ideal, but it should get us up-and-limping well - enough to run the configure script, which is all that matters. -*/ -# ifdef memchr -# undef memchr -# endif -# define memchr bootstrap_memchr - -static VOID *bootstrap_memchr P_((const VOID *s, int c, size_t n)); -static VOID * -bootstrap_memchr(s, c, n) - const VOID *s; - int c; - size_t n; -{ - char *p; - - for (p=(char *)s; n-- > 0; ++p) - if (*p == c) - return p; - return CAST(VOID *)0; -} -#endif /*BOOTSTRAP*/ - /* increase a struct line's length, making some attempt at keeping realloc() calls under control by padding for future growth. */ static void resize_line P_((struct line *, size_t)); @@ -727,11 +694,9 @@ open_next_file(name, input) { int input_fd; char *tmpdir, *p; -#ifndef BOOTSTRAP security_context_t old_fscreatecon; int reset_fscreatecon = 0; memset (&old_fscreatecon, 0, sizeof (old_fscreatecon)); -#endif /* get the base name */ tmpdir = ck_strdup(input->in_file_name); @@ -748,7 +713,6 @@ open_next_file(name, input) if (!S_ISREG (input->st.st_mode)) panic(_("couldn't edit %s: not a regular file"), input->in_file_name); -#ifndef BOOTSTRAP if (is_selinux_enabled () > 0) { security_context_t con; @@ -769,20 +733,17 @@ open_next_file(name, input) myname, input->in_file_name, strerror (errno)); } } -#endif output_file.fp = ck_mkstemp (&input->out_file_name, tmpdir, "sed", write_mode); output_file.missing_newline = false; free (tmpdir); -#ifndef BOOTSTRAP if (reset_fscreatecon) { setfscreatecon (old_fscreatecon); freecon (old_fscreatecon); } -#endif if (!output_file.fp) panic(_("couldn't open temporary file %s: %s"), input->out_file_name, strerror(errno)); diff --git a/sed/sed.c b/sed/sed.c index 7d366bf..e0d5771 100644 --- a/sed/sed.c +++ b/sed/sed.c @@ -46,11 +46,9 @@ #include "version-etc.h" -#ifndef BOOTSTRAP #ifndef HAVE_STDLIB_H extern char *getenv P_((const char *)); #endif -#endif #ifndef HAVE_STRTOUL # define ATOI(x) atoi(x) diff --git a/sed/sed.h b/sed/sed.h index 7ecea24..6d1c68a 100644 --- a/sed/sed.h +++ b/sed/sed.h @@ -22,11 +22,8 @@ #include "basicdefs.h" #include "regexp.h" - -#ifndef BOOTSTRAP #include #include "unlocked-io.h" -#endif #include "utils.h"