This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Move cpplib to the toplevel


Changes WRT the previous version:

- I left hashtable.h in cpplib
- I thus avoided messing with boehm-gc and libiberty
- but, I have to link in libcpp.a in $(BACKEND) for all front-ends.
- I added a note about input charsets being disabled.
- minor cleanups due to tree-ssa merge.

Bootstrapped/regtested i686-pc-linux-gnu, no new regression, all working languages.

Paolo

ChangeLog:

2004-05-20 Paolo Bonzini <bonzini@gnu.org>

	* Makefile.def (host_modules): add libcpp.
	* Makefile.tpl: Add dependencies on and for libcpp.
	* Makefile.in: Regenerate.
	* configure.in: Add libcpp host module.
	* configure: Regenerate.

config/ChangeLog:

2004-05-20 Paolo Bonzini <bonzini@gnu.org>

	* acx.m4 (ACX_HEADER_STDBOOL, ACX_HEADER_STRING):
	From gcc.

gcc/ChangeLog:

2004-05-20 Paolo Bonzini <bonzini@gnu.org>

	Move libcpp to the toplevel.
	* Makefile.in: Remove references to libcpp files,
	use LIBCPP instead of libcpp.a.  Define HASHTABLE_H
	and change hashtable.h to that.
	* aclocal.m4 (gcc_AC_HEADER_STDBOOL,
	gcc_AC_HEADER_STRING, gcc_AC_C__BOOL): Remove.
	* configure.ac (gcc_AC_C__BOOL, HAVE_UCHAR): Remove tests.
	* configure: Regenerate.
	* config.in: Regenerate.
	* cppcharset.c: Removed.
	* cpperror.c: Removed.
	* cppexp.c: Removed.
	* cppfiles.c: Removed.
	* cpphash.c: Removed.
	* cpphash.h: Removed.
	* cppinit.c: Removed.
	* cpplex.c: Removed.
	* cpplib.c: Removed.
	* cpplib.h: Removed.
	* cppmacro.c: Removed.
	* cpppch.c: Removed.
	* cpptrad.c: Removed.
	* cppucnid.h: Removed.
	* cppucnid.pl: Removed.
	* cppucnid.tab: Removed.
	* line-map.c: Removed.
	* line-map.h: Removed.
	* mkdeps.c: Removed.
	* mkdeps.h: Removed.
	* system.h (O_NONBLOCK, O_NOCTTY): Do not define.

gcc/cp/ChangeLog:

* Make-lang.in: No need to specify $(LIBCPP).

gcc/java/ChangeLog:

* Make-lang.in: Link in $(LIBCPP) instead of mkdeps.o.

libcpp/ChangeLog:

2004-05-20 Paolo Bonzini <bonzini@gnu.org>

	Moved libcpp from the gcc subdirectory to the toplevel.
	* Makefile.am: New file.
	* Makefile.in: Regenerate.
	* configure.ac: New file.
	* configure: Regenerate.
	* config.in: Regenerate.
	* cppcharset.c: Moved from gcc.  Add note about
	brokenness of input charset detection.
	* cpperror.c: Moved from gcc.  Do not include intl.h.
	* cppexp.c: Moved from gcc.
	* cppfiles.c: Moved from gcc.  Do not include intl.h.
	Remove #define of O_BINARY, it is in system.h.
	* cpphash.c: Moved from gcc.
	* cpphash.h: Moved from gcc.
	* cppinit.c: Moved from gcc.
	* cpplex.c: Moved from gcc.
	* cpplib.c: Moved from gcc.
	* cpplib.h: Moved from gcc.
	* cppmacro.c: Moved from gcc.
	* cpppch.c: Moved from gcc.  Do not include intl.h.
	* cpptrad.c: Moved from gcc.
	* cppucnid.h: Moved from gcc.
	* cppucnid.pl: Moved from gcc.
	* cppucnid.tab: Moved from gcc.
	* hashtable.c: Moved from gcc.
	* hashtable.h: Moved from gcc.
	* line-map.c: Moved from gcc.  Do not include intl.h.
	* line-map.h: Moved from gcc.
	* mkdeps.c: Moved from gcc.
	* mkdeps.h: Moved from gcc.
	* system.h: New file.

libcpp/po/ChangeLog:

2004-05-20 Paolo Bonzini <bonzini@gnu.org>

	* be.po: Extracted from gcc/po/be.po.
	* ca.po: Extracted from gcc/po/ca.po.
	* da.po: Extracted from gcc/po/da.po.
	* de.po: Extracted from gcc/po/de.po.
	* el.po: Extracted from gcc/po/el.po.
	* es.po: Extracted from gcc/po/es.po.
	* fr.po: Extracted from gcc/po/fr.po.
	* ja.po: Extracted from gcc/po/ja.po.
	* nl.po: Extracted from gcc/po/nl.po.
	* sv.po: Extracted from gcc/po/sv.po.
	* tr.po: Extracted from gcc/po/tr.po.

libiberty/ChangeLog: [obvious]

2004-05-20 Paolo Bonzini <bonzini@gnu.org>

* hashtab.c: hashtable.c is not in gcc anymore.

diff -rNU3 gcc-pre-patch/Makefile.def gcc/Makefile.def
--- gcc-pre-patch/Makefile.def	2004-05-19 15:57:55.000000000 +0200
+++ gcc/Makefile.def	2004-05-19 16:07:45.000000000 +0200
@@ -59,6 +59,7 @@
                 missing=mostlyclean; };
 host_modules= { module= itcl; };
 host_modules= { module= ld; bootstrap=true; };
+host_modules= { module= libbanshee; bootstrap=true; no_install=true; };
+host_modules= { module= libcpp; bootstrap=true; no_install=true; };
 host_modules= { module= libgui; };
-host_modules= { module= libbanshee; bootstrap=true; no_install=true; };
 host_modules= { module= libiberty; bootstrap=true; };
diff -rNU3 gcc-pre-patch/Makefile.tpl gcc/Makefile.tpl
--- gcc-pre-patch/Makefile.tpl	2004-05-19 15:57:55.000000000 +0200
+++ gcc/Makefile.tpl	2004-05-19 16:08:48.000000000 +0200
@@ -1609,10 +1609,12 @@
 # GCC needs to identify certain tools.
 # GCC also needs the information exported by the intl configure script.
 configure-gcc: maybe-configure-intl maybe-configure-binutils maybe-configure-gas maybe-configure-ld maybe-configure-bison maybe-configure-flex
-all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib maybe-all-libbanshee
+all-gcc: maybe-all-libiberty maybe-all-intl maybe-all-bison maybe-all-byacc maybe-all-binutils maybe-all-gas maybe-all-ld maybe-all-zlib maybe-all-libbanshee maybe-all-libcpp
+configure-libcpp: maybe-configure-libiberty maybe-configure-intl
+all-libcpp: maybe-all-libiberty maybe-all-intl
 # This is a slightly kludgy method of getting dependencies on 
 # all-build-libiberty correct; it would be better to build it every time.
-all-gcc: maybe-all-build-libiberty maybe-all-libbanshee
+all-gcc: maybe-all-build-libiberty
 all-bootstrap: [+ FOR host_modules +][+ IF bootstrap +]maybe-all-[+module+] [+ ENDIF bootstrap +][+ ENDFOR host_modules +]
 
 # Host modules specific to gdb.
diff -rNU3 gcc-pre-patch/config/acx.m4 gcc/config/acx.m4
--- gcc-pre-patch/config/acx.m4	2004-05-19 15:57:56.000000000 +0200
+++ gcc/config/acx.m4	2004-05-19 16:03:32.000000000 +0200
@@ -224,3 +224,37 @@
 do_compare="$gcc_cv_prog_cmp_skip"
 AC_SUBST(do_compare)
 ])
+
+dnl See whether we can include both string.h and strings.h.
+AC_DEFUN([ACX_HEADER_STRING],
+[AC_CACHE_CHECK([whether string.h and strings.h may both be included],
+  gcc_cv_header_string,
+[AC_TRY_COMPILE([#include <string.h>
+#include <strings.h>], , gcc_cv_header_string=yes, gcc_cv_header_string=no)])
+if test $gcc_cv_header_string = yes; then
+  AC_DEFINE(STRING_WITH_STRINGS, 1, [Define if you can safely include both <string.h> and <strings.h>.])
+fi
+])
+
+dnl See if stdbool.h properly defines bool and true/false.
+dnl Check whether _Bool is built-in.
+AC_DEFUN([ACX_HEADER_STDBOOL],
+[AC_CACHE_CHECK([for working stdbool.h],
+  ac_cv_header_stdbool_h,
+[AC_TRY_COMPILE([#include <stdbool.h>],
+[bool foo = false;],
+ac_cv_header_stdbool_h=yes, ac_cv_header_stdbool_h=no)])
+if test $ac_cv_header_stdbool_h = yes; then
+  AC_DEFINE(HAVE_STDBOOL_H, 1,
+  [Define if you have a working <stdbool.h> header file.])
+fi
+AC_CACHE_CHECK(for built-in _Bool, gcc_cv_c__bool,
+[AC_TRY_COMPILE(,
+[_Bool foo;],
+gcc_cv_c__bool=yes, gcc_cv_c__bool=no)
+])
+if test $gcc_cv_c__bool = yes; then
+  AC_DEFINE(HAVE__BOOL, 1, [Define if the \`_Bool' type is built-in.])
+fi
+])
+
diff -rNU3 gcc-pre-patch/configure.in gcc/configure.in
--- gcc-pre-patch/configure.in	2004-05-19 15:57:55.000000000 +0200
+++ gcc/configure.in	2004-05-19 16:27:15.000000000 +0200
@@ -126,7 +126,7 @@
 
 # these libraries are used by various programs built for the host environment
 #
-host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib libbanshee"
+host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl tix libgui zlib libbanshee libcpp"
 
 # these tools are built for the host environment
 # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
diff -rNU3 gcc-pre-patch/gcc/Makefile.in gcc/gcc/Makefile.in
--- gcc-pre-patch/gcc/Makefile.in	2004-05-19 15:58:09.000000000 +0200
+++ gcc/gcc/Makefile.in	2004-05-20 11:31:29.000000000 +0200
@@ -700,7 +700,8 @@
 C_TREE_H = c-tree.h $(C_COMMON_H)
 SYSTEM_H = system.h hwint.h $(srcdir)/../include/libiberty.h
 PREDICT_H = predict.h predict.def
-CPPLIB_H = cpplib.h line-map.h
+CPPLIB_H = $(srcdir)/../libcpp/cpplib.h $(srcdir)/../libcpp/line-map.h
+HASHTABLE_H = $(srcdir)/../libcpp/hashtable.h
 TREE_DUMP_H = tree-dump.h $(SPLAY_TREE_H)
 TREE_GIMPLE_H = tree-gimple.h tree-iterator.h
 TREE_FLOW_H = tree-flow.h tree-flow-inline.h tree-ssa-operands.h \
@@ -729,10 +730,11 @@
 # Build and host support libraries.  FORBUILD is either
 # .. or ../$(build_alias) depending on whether host != build.
 LIBIBERTY = ../libiberty/libiberty.a
+LIBCPP = ../libcpp/libcpp.a
 BUILD_LIBIBERTY = @FORBUILD@/libiberty/libiberty.a
 
 # Dependencies on the intl and portability libraries.
-LIBDEPS= $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) libcpp.a $(BANSHEELIB)
+LIBDEPS= $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) $(LIBCPP) $(BANSHEELIB)
 
 # Likewise, for use in the tools that must run on this machine
 # even if we are cross-building GCC.
@@ -740,7 +742,7 @@
 
 # How to link with both our special library facilities
 # and the system's installed libraries.
-LIBS = @LIBS@ libcpp.a $(LIBIBERTY) $(LIBINTL) $(LIBICONV) $(BANSHEELIB)
+LIBS = @LIBS@ $(LIBCPP) $(LIBIBERTY) $(LIBINTL) $(LIBICONV) $(BANSHEELIB)
 
 # Any system libraries needed just for GNAT.
 SYSLIBS = @GNAT_LIBEXC@
@@ -770,7 +772,7 @@
 # libintl.h will be found in ../intl if we are using the included libintl.
 INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \
 	   -I$(srcdir)/../include @INCINTL@ \
-	   $(BANSHEEINC) $(GMPINC)
+	   -I$(srcdir)/../libcpp $(BANSHEEINC) $(GMPINC)
 
 .c.o:
 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
@@ -899,14 +901,14 @@
  rtl-profile.o tree-profile.o
 
 OBJS-md = $(out_object_file)
-OBJS-archive = $(EXTRA_OBJS) $(host_hook_obj) hashtable.o tree-inline.o	   \
+OBJS-archive = $(EXTRA_OBJS) $(host_hook_obj) tree-inline.o		   \
   cgraph.o cgraphunit.o tree-nomudflap.o
 
 OBJS = $(OBJS-common) $(out_object_file) $(OBJS-archive)
 
 OBJS-onestep = libbackend.o $(OBJS-archive)
 
-BACKEND = main.o @TREEBROWSER@ libbackend.a
+BACKEND = main.o @TREEBROWSER@ libbackend.a $(LIBCPP)
 
 # Files to be copied away after each stage in building.
 STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
@@ -928,7 +930,7 @@
  protoize$(exeext) unprotoize$(exeext) \
  $(SPECS) collect2$(exeext) \
  gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
- *.[0-9][0-9].* *.[si] libcpp.a libbackend.a libgcc.mk \
+ *.[0-9][0-9].* *.[si] libbackend.a libgcc.mk \
  $(LANG_STAGESTUFF)
 
 # Defined in libgcc2.c, included only in the static library.
@@ -1122,7 +1124,7 @@
 # This is used only if the user explicitly asks for it.
 compilations: $(BACKEND)
 
-# Like libcpp.a, this archive is strictly for the host.
+# This archive is strictly for the host.
 libbackend.a: $(OBJS@onestep@)
 	-rm -rf libbackend.a
 	$(AR) $(AR_FLAGS) libbackend.a $(OBJS@onestep@)
@@ -1352,7 +1354,7 @@
     c-pragma.h input.h intl.h flags.h toplev.h output.h \
     $(CPPLIB_H) $(EXPR_H) $(TM_P_H)
 c-ppoutput.o : c-ppoutput.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
-    $(C_COMMON_H) $(TREE_H) $(CPPLIB_H) cpphash.h $(TM_P_H) c-pragma.h
+    $(C_COMMON_H) $(TREE_H) $(CPPLIB_H) $(srcdir)/../libcpp/cpphash.h $(TM_P_H) c-pragma.h
 c-objc-common.o : c-objc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
     $(C_TREE_H) $(RTL_H) insn-config.h $(INTEGRATE_H) $(EXPR_H) $(C_TREE_H) \
     flags.h toplev.h tree-inline.h $(DIAGNOSTIC_H) $(VARRAY_H) \
@@ -2259,10 +2261,10 @@
 	$(SHELL) $(srcdir)/../move-if-change tmp-preds.h tm-preds.h
 	$(STAMP) s-preds
 
-GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h $(srcdir)/cpplib.h \
+GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h $(srcdir)/../libcpp/cpplib.h \
   $(host_xm_file_list) $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) \
   $(srcdir)/bitmap.h $(srcdir)/coverage.c $(srcdir)/function.h  $(srcdir)/rtl.h \
-  $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h \
+  $(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/libfuncs.h $(HASHTABLE_H) \
   $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h $(srcdir)/hwint.h \
   $(srcdir)/cselib.h $(srcdir)/basic-block.h  $(srcdir)/cgraph.h \
   $(srcdir)/c-common.h $(srcdir)/c-tree.h \
@@ -2551,42 +2553,12 @@
   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
   @TARGET_SYSTEM_ROOT_DEFINE@
 
-LIBCPP_OBJS =	cpplib.o cpplex.o cppmacro.o cppexp.o cppfiles.o cpptrad.o \
-		cpphash.o cpperror.o cppinit.o cppcharset.o \
-		hashtable.o line-map.o mkdeps.o cpppch.o
-
-LIBCPP_DEPS =	$(CPPLIB_H) cpphash.h line-map.h hashtable.h intl.h \
-		$(OBSTACK_H) $(CONFIG_H) $(SYSTEM_H)
-
-# Most of the other archives built/used by this makefile are for
-# targets.  This one is strictly for the host.
-libcpp.a: $(LIBCPP_OBJS)
-	-rm -rf libcpp.a
-	$(AR) $(AR_FLAGS) libcpp.a $(LIBCPP_OBJS)
-	-$(RANLIB) libcpp.a
-
-cppcharset.o: cppcharset.c $(LIBCPP_DEPS) cppucnid.h
-cpperror.o: cpperror.c $(LIBCPP_DEPS)
-cppexp.o:   cppexp.c   $(LIBCPP_DEPS)
-cpplex.o:   cpplex.c   $(LIBCPP_DEPS)
-cppmacro.o: cppmacro.c $(LIBCPP_DEPS)
-cpplib.o:   cpplib.c   $(LIBCPP_DEPS)
-cpphash.o:  cpphash.c  $(LIBCPP_DEPS)
-cpptrad.o:  cpptrad.c  $(LIBCPP_DEPS)
-cppfiles.o: cppfiles.c $(LIBCPP_DEPS) $(HASHTAB_H) $(MD5_H) mkdeps.h
-cppinit.o:  cppinit.c  $(LIBCPP_DEPS) mkdeps.h
-cpppch.o:   cpppch.c   $(LIBCPP_DEPS) mkdeps.h
-
 cppdefault.o: cppdefault.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
 	cppdefault.h Makefile
 	$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
 	  $(PREPROCESSOR_DEFINES) \
 	  -c $(srcdir)/cppdefault.c $(OUTPUT_OPTION)
 
-mkdeps.o: mkdeps.c $(CONFIG_H) $(SYSTEM_H) mkdeps.h
-hashtable.o: hashtable.c hashtable.h $(CONFIG_H) $(SYSTEM_H) $(OBSTACK_H)
-line-map.o: line-map.c line-map.h intl.h $(CONFIG_H) $(SYSTEM_H)
-
 # Note for the stamp targets, we run the program `true' instead of
 # having an empty command (nothing following the semicolon).
 
@@ -2800,7 +2772,7 @@
 # This is nominally a 'build' program, but it's run only when host==build,
 # so we can (indeed, must) use $(LIBDEPS) and $(LIBS).
 fix-header$(build_exeext): fix-header.o scan-decls.o scan.o xsys-protos.h \
-           c-incpath.o cppdefault.o prefix.o $(LIBDEPS) libcpp.a
+           c-incpath.o cppdefault.o prefix.o $(LIBDEPS)
 	$(CC_FOR_BUILD) $(BUILD_CFLAGS) $(BUILD_LDFLAGS) -o $@ fix-header.o \
 	c-incpath.o cppdefault.o scan-decls.o prefix.o scan.o $(LIBS)
 
@@ -3538,7 +3510,7 @@
 # ------------------------------------------------------
 
 # A list of files to be destroyed during "lean" builds.
-VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_OBJS) $(LIBCPP_OBJS) *.c *.h gen*`
+VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_OBJS) *.c *.h gen*`
 
 # Flags to pass to stage2 and later recursive makes.  Note that the
 # WARN_CFLAGS setting can't be to the expansion of GCC_WARN_CFLAGS in
diff -rNU3 gcc-pre-patch/gcc/aclocal.m4 gcc/gcc/aclocal.m4
--- gcc-pre-patch/gcc/aclocal.m4	2004-05-19 15:58:09.000000000 +0200
+++ gcc/gcc/aclocal.m4	2004-05-19 16:06:21.000000000 +0200
@@ -3,30 +3,6 @@
 sinclude(../config/gettext.m4)
 sinclude(../config/progtest.m4)
 
-dnl See if stdbool.h properly defines bool and true/false.
-AC_DEFUN([gcc_AC_HEADER_STDBOOL],
-[AC_CACHE_CHECK([for working stdbool.h],
-  ac_cv_header_stdbool_h,
-[AC_TRY_COMPILE([#include <stdbool.h>],
-[bool foo = false;],
-ac_cv_header_stdbool_h=yes, ac_cv_header_stdbool_h=no)])
-if test $ac_cv_header_stdbool_h = yes; then
-  AC_DEFINE(HAVE_STDBOOL_H, 1,
-  [Define if you have a working <stdbool.h> header file.])
-fi
-])
-
-dnl See whether we can include both string.h and strings.h.
-AC_DEFUN([gcc_AC_HEADER_STRING],
-[AC_CACHE_CHECK([whether string.h and strings.h may both be included],
-  gcc_cv_header_string,
-[AC_TRY_COMPILE([#include <string.h>
-#include <strings.h>], , gcc_cv_header_string=yes, gcc_cv_header_string=no)])
-if test $gcc_cv_header_string = yes; then
-  AC_DEFINE(STRING_WITH_STRINGS, 1, [Define if you can safely include both <string.h> and <strings.h>.])
-fi
-])
-
 dnl See whether we need a declaration for a function.
 dnl The result is highly dependent on the INCLUDES passed in, so make sure
 dnl to use a different cache variable name in this macro if it is invoked
@@ -198,18 +174,6 @@
 AC_SUBST(LN)dnl
 ])
 
-dnl Check whether _Bool is built-in.
-AC_DEFUN([gcc_AC_C__BOOL],
-[AC_CACHE_CHECK(for built-in _Bool, gcc_cv_c__bool,
-[AC_TRY_COMPILE(,
-[_Bool foo;],
-gcc_cv_c__bool=yes, gcc_cv_c__bool=no)
-])
-if test $gcc_cv_c__bool = yes; then
-  AC_DEFINE(HAVE__BOOL, 1, [Define if the \`_Bool' type is built-in.])
-fi
-])
-
 dnl Define MKDIR_TAKES_ONE_ARG if mkdir accepts only one argument instead
 dnl of the usual 2.
 AC_DEFUN([gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG],
diff -rNU3 gcc-pre-patch/gcc/configure.ac gcc/gcc/configure.ac
--- gcc-pre-patch/gcc/configure.ac	2004-05-19 15:58:10.000000000 +0200
+++ gcc/gcc/configure.ac	2004-05-19 16:00:39.000000000 +0200
@@ -278,7 +278,6 @@
 AC_C_INLINE
 
 gcc_AC_C_LONG_LONG
-gcc_AC_C__BOOL
 
 # sizeof(char) is 1 by definition.
 AC_COMPILE_CHECK_SIZEOF(void *)
@@ -806,8 +805,8 @@
 
 AC_HEADER_STDC
 AC_HEADER_TIME
-gcc_AC_HEADER_STDBOOL
-gcc_AC_HEADER_STRING
+ACX_HEADER_STDBOOL
+ACX_HEADER_STRING
 AC_HEADER_SYS_WAIT
 AC_CHECK_HEADERS(limits.h stddef.h string.h strings.h stdlib.h time.h \
 		 fcntl.h unistd.h sys/file.h sys/time.h sys/mman.h \
@@ -1039,19 +1038,6 @@
   [Define if <time.h> defines clock_t.])
 fi
 
-AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
-[AC_TRY_COMPILE([
-#include "ansidecl.h"
-#include "system.h"
-], 
-[if ((uchar *)0) return 0;
- if (sizeof(uchar)) return 0;],
-ac_cv_type_uchar=yes, ac_cv_type_uchar=no)])
-if test $ac_cv_type_uchar = yes; then
-  AC_DEFINE(HAVE_UCHAR, 1,
-  [Define if <sys/types.h> defines \`uchar'.])
-fi
-
 # Restore CFLAGS from before the gcc_AC_NEED_DECLARATIONS tests.
 CFLAGS="$saved_CFLAGS"
 
diff -rNU3 gcc-pre-patch/gcc/cp/Make-lang.in gcc/gcc/cp/Make-lang.in
--- gcc-pre-patch/gcc/cp/Make-lang.in	2004-05-19 15:58:46.000000000 +0200
+++ gcc/gcc/cp/Make-lang.in	2004-05-20 11:30:17.000000000 +0200
@@ -88,9 +88,9 @@
 cp-warn = $(STRICT_WARN) $(WERROR)
 
 cc1plus$(exeext): $(CXX_OBJS) $(CXX_C_OBJS) $(BACKEND) \
-		  libcpp.a $(LIBDEPS)
+		  $(LIBDEPS)
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
-	      $(CXX_OBJS) $(CXX_C_OBJS) $(BACKEND) libcpp.a $(LIBS)
+	      $(CXX_OBJS) $(CXX_C_OBJS) $(BACKEND) $(LIBS)
 
 # Special build rules.
 $(srcdir)/cp/cfns.h: $(srcdir)/cp/cfns.gperf
diff -rNU3 gcc-pre-patch/gcc/java/Make-lang.in gcc/gcc/java/Make-lang.in
--- gcc-pre-patch/gcc/java/Make-lang.in	2004-05-19 15:58:53.000000000 +0200
+++ gcc/gcc/java/Make-lang.in	2004-05-20 11:30:38.000000000 +0200
@@ -105,16 +105,16 @@
   java/zextract.o java/jcf-io.o java/win32-host.o java/jcf-parse.o java/mangle.o \
   java/mangle_name.o java/builtins.o java/resource.o \
   java/jcf-write.o java/buffer.o java/check-init.o java/jcf-depend.o \
-  java/jcf-path.o java/xref.o java/boehm.o java/java-gimplify.o mkdeps.o
+  java/jcf-path.o java/xref.o java/boehm.o java/java-gimplify.o
 
 GCJH_OBJS = java/gjavah.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \
-  java/win32-host.o java/zextract.o version.o mkdeps.o errors.o ggc-none.o \
+  java/win32-host.o java/zextract.o version.o errors.o ggc-none.o \
   intl.o
 
 JVSCAN_OBJS = java/parse-scan.o java/jv-scan.o version.o intl.o
 
 JCFDUMP_OBJS = java/jcf-dump.o java/jcf-io.o java/jcf-depend.o java/jcf-path.o \
-		java/win32-host.o java/zextract.o errors.o version.o mkdeps.o ggc-none.o intl.o
+		java/win32-host.o java/zextract.o errors.o version.o ggc-none.o intl.o
 
 JVGENMAIN_OBJS = java/jvgenmain.o java/mangle_name.o errors.o intl.o
 
@@ -130,7 +130,7 @@
 
 gcjh$(exeext): $(GCJH_OBJS) $(LIBDEPS)
 	rm -f $@
-	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCJH_OBJS) $(ZLIB) $(LIBS)
+	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCJH_OBJS) $(LIBCPP) $(ZLIB) $(LIBS)
 
 jv-scan$(exeext): $(JVSCAN_OBJS) $(LIBDEPS)
 	rm -f $@
@@ -139,7 +139,7 @@
 jcf-dump$(exeext): $(JCFDUMP_OBJS) $(LIBDEPS)
 	rm -f $@
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(JCFDUMP_OBJS) \
-		$(ZLIB) $(LDEXP_LIB) $(LIBS)
+		$(LIBCPP) $(ZLIB) $(LDEXP_LIB) $(LIBS)
 
 jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(LIBDEPS)
 	rm -f $@
diff -rNU3 gcc-pre-patch/gcc/system.h gcc/gcc/system.h
--- gcc-pre-patch/gcc/system.h	2004-05-19 15:58:22.000000000 +0200
+++ gcc/gcc/system.h	2004-05-19 16:00:39.000000000 +0200
@@ -421,16 +421,6 @@
 # endif
 #endif
 
-/* Approximate O_NONBLOCK.  */
-#ifndef O_NONBLOCK
-#define O_NONBLOCK O_NDELAY
-#endif
-
-/* Approximate O_NOCTTY.  */
-#ifndef O_NOCTTY
-#define O_NOCTTY 0
-#endif
-
 /* Define well known filenos if the system does not define them.  */
 #ifndef STDIN_FILENO
 # define STDIN_FILENO   0
diff -rNU3 gcc-pre-patch/libcpp/Makefile.am gcc/libcpp/Makefile.am
--- gcc-pre-patch/libcpp/Makefile.am	1970-01-01 01:00:00.000000000 +0100
+++ gcc/libcpp/Makefile.am	2004-05-20 11:29:18.000000000 +0200
@@ -0,0 +1,71 @@
+ACLOCAL_AMFLAGS = -I ../config
+AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir) -I$(srcdir)/../intl
+
+lib_LIBRARIES = libcpp.a
+libcpp_a_SOURCES = \
+	cppcharset.c cpperror.c cppexp.c cppfiles.c cpphash.c cppinit.c \
+	cpplex.c cpplib.c cppmacro.c cpppch.c cpptrad.c hashtable.c \
+	line-map.c mkdeps.c
+
+include_HEADERS = cpplib.h line-map.h cpphash.h hashtable.h mkdeps.h
+
+XGETTEXT = @XGETTEXT@
+GMSGFMT = @GMSGFMT@
+MSGMERGE = msgmerge
+CATALOGS = @CATALOGS@
+
+if ENABLE_NLS
+build-po: $(CATALOGS)
+update-po: $(CATALOGS:.gmo=.pox)
+else
+build-po:
+update-po:
+endif
+
+# N.B. We do not attempt to copy these into $(srcdir).
+.po.gmo:
+	-test -d $(srcdir)/po || mkdir $(srcdir)/po
+	$(GMSGFMT) --statistics -o $@ $<
+
+# The new .po has to be gone over by hand, so we deposit it into
+# build/po with a different extension.
+# If build/po/$(PACKAGE).pot exists, use it (it was just created),
+# else use the one in srcdir.
+.po.pox:
+	-test -d $(srcdir)/po || mkdir $(srcdir)/po
+	$(MSGMERGE) $< `if test -f po/$(PACKAGE).pot; \
+	                then echo po/$(PACKAGE).pot; \
+	                else echo $(srcdir)/po/$(PACKAGE).pot; fi` -o $@
+
+# This rule has to look for .gmo modules in both srcdir and
+# the cwd, and has to check that we actually have a catalog
+# for each language, in case they weren't built or included
+# with the distribution.
+install-data-local:
+	$(mkinstalldirs) $(DESTDIR)$(datadir)
+	cats="$(CATALOGS)"; for cat in $$cats; do \
+	  lang=`basename $$cat | sed 's/\.gmo$$//'`; \
+	  if [ -f $$cat ]; then :; \
+	  elif [ -f $(srcdir)/$$cat ]; then cat=$(srcdir)/$$cat; \
+	  else continue; \
+	  fi; \
+	  dir=$(localedir)/$$lang/LC_MESSAGES; \
+	  echo $(mkinstalldirs) $(DESTDIR)$$dir; \
+	  $(mkinstalldirs) $(DESTDIR)$$dir || exit 1; \
+	  echo $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
+	  $(INSTALL_DATA) $$cat $(DESTDIR)$$dir/$(PACKAGE).mo; \
+	done
+
+# Rule for regenerating the message template (gcc.pot).
+# Instead of forcing everyone to edit POTFILES.in, which proved impractical,
+# this rule has no dependencies and always regenerates libcpp.pot.  This is
+# relatively harmless since the .po files do not directly depend on it.
+.PHONY: po/$(PACKAGE).pot
+po/$(PACKAGE).pot: $(libcpp_a_SOURCES) $(noinst_HEADERS)
+	-test -d $(srcdir)/po || mkdir $(srcdir)/po
+	$(XGETTEXT) --default-domain=$(PACKAGE) \
+	  --keyword=cpp_error,3 --keyword=cpp_errno,3 \
+	  --keyword=cpp_error_with_line,5 \
+	  --copyright-holder="Free Software Foundation, Inc." \
+	  --msgid-bugs-address="http://gcc.gnu.org/bugs.html"; \
+	  --language=c -o po/$(PACKAGE).pot $^
diff -rNU3 gcc-pre-patch/libcpp/configure.ac gcc/libcpp/configure.ac
--- gcc-pre-patch/libcpp/configure.ac	1970-01-01 01:00:00.000000000 +0100
+++ gcc/libcpp/configure.ac	2004-05-19 16:00:39.000000000 +0200
@@ -0,0 +1,96 @@
+#                                               -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.57)
+AC_INIT(cpplib, [ ], gcc-bugs@gcc.gnu.org, cpplib)
+AC_CONFIG_SRCDIR(cpplib.c)
+AC_CANONICAL_SYSTEM
+AM_INIT_AUTOMAKE(foreign)
+AM_MAINTAINER_MODE
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_RANLIB
+
+# Checks for header files.
+AC_HEADER_TIME
+ACX_HEADER_STRING
+ACX_HEADER_STDBOOL
+AC_CHECK_HEADERS(iconv.h locale.h fcntl.h limits.h stddef.h \
+	stdlib.h strings.h string.h sys/file.h unistd.h)
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_C_INLINE
+AC_FUNC_OBSTACK
+AC_TYPE_OFF_T
+AC_TYPE_SIZE_T
+AC_STRUCT_TM
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_FUNCS(putc_unlocked fputc_unlocked fputs_unlocked \
+        fwrite_unlocked fprintf_unlocked)
+AC_CHECK_DECLS([abort, errno, putc_unlocked, fputc_unlocked,
+        fputs_unlocked, fwrite_unlocked, fprintf_unlocked])
+
+# Checks for library functions.
+AC_FUNC_ALLOCA
+AC_HEADER_STDC
+AM_LANGINFO_CODESET
+ZW_GNU_GETTEXT_SISTER_DIR
+
+AC_CACHE_CHECK(for uchar, gcc_cv_type_uchar,
+[AC_TRY_COMPILE([
+#include "ansidecl.h"
+#include "system.h"
+],
+[if ((uchar *)0) return 0;
+ if (sizeof(uchar)) return 0;],
+ac_cv_type_uchar=yes, ac_cv_type_uchar=no)])
+if test $ac_cv_type_uchar = yes; then
+  AC_DEFINE(HAVE_UCHAR, 1,
+  [Define if <sys/types.h> defines \`uchar'.])
+fi
+
+AM_ICONV
+AM_CONDITIONAL(ENABLE_NLS, [test "x$enable_nls" != xno])
+AC_ARG_ENABLE(checking,
+[  --enable-checking      enable expensive run-time checks],,
+enable_checking=no)
+
+if test $enable_checking != no ; then
+  AC_DEFINE(ENABLE_CHECKING, 1,
+[Define if you want more run-time sanity checks.])
+fi
+
+case $target in
+	alpha*-*-* | \
+	x86_64-*-* | \
+	ia64-*-* | \
+	hppa*64*-*-* | parisc*64*-*-* | \
+	mips*-*-* | \
+	mmix-*-* | \
+	powerpc*-*-* | \
+	rs6000*-*-* | \
+	s390*-*-* | \
+	sparc64*-*-* | ultrasparc-*-freebsd* | \
+	sparcv9-*-solaris2* | \
+	sparc-*-solaris2.[789] | sparc-*-solaris2.1[0-9] | \
+	sh[123456789l]*-*-*)
+		need_64bit_hwint=yes ;;
+	*)
+		need_64bit_hwint=no ;;
+esac
+
+case $need_64bit_hwint:$ac_cv_sizeof_long in
+	*:8 | no:*) host_wide_int=long ;;
+	*) host_wide_int='long long' ;;
+esac
+
+AC_DEFINE_UNQUOTED(HOST_WIDE_INT, $host_wide_int,
+[Define to the widest efficient host integer type at least
+   as wide as the target's size_t type.])
+
+AC_CONFIG_HEADERS(config.h:config.in)
+AC_CONFIG_FILES(Makefile)
+AC_OUTPUT
diff -rNU3 gcc-pre-patch/libcpp/cppcharset.c gcc/libcpp/cppcharset.c
--- gcc-pre-patch/libcpp/cppcharset.c	2004-05-19 16:00:04.000000000 +0200
+++ gcc/libcpp/cppcharset.c	2004-05-20 11:28:09.000000000 +0200
@@ -1400,7 +1400,25 @@
 {
   const char *current_encoding = NULL;
 
-#if defined (HAVE_LOCALE_H) && defined (HAVE_LANGINFO_CODESET)
+  /* We disable this because the default codeset is 7-bit ASCII on
+     most platforms, and this causes conversion failures on every
+     file in GCC that happens to have one of the upper 128 characters
+     in it -- most likely, as part of the name of a contributor.
+     We should definitely recognize in-band markers of file encoding,
+     like:
+     - the appropriate Unicode byte-order mark (FE FF) to recognize
+       UTF16 and UCS4 (in both big-endian and little-endian flavors)
+       and UTF8
+     - a "#i", "#d", "/*", "//", " #p" or "#p" (for #pragma) to
+       distinguish ASCII and EBCDIC.
+     - now we can parse something like "#pragma GCC encoding <xyz>
+       on the first line, or even Emacs/VIM's mode line tags (there's
+       a problem here in that VIM uses the last line, and Emacs has
+       its more elaborate "Local variables:" convention).
+     - investigate whether Java has another common convention, which
+       would be friendly to support.
+     (Zack Weinberg, with edits by Paolo Bonzini, May 20th 2004)  */
+#if defined (HAVE_LOCALE_H) && defined (HAVE_LANGINFO_CODESET) && 0
   setlocale (LC_CTYPE, "");
   current_encoding = nl_langinfo (CODESET);
 #endif
diff -rNU3 gcc-pre-patch/libcpp/cpperror.c gcc/libcpp/cpperror.c
--- gcc-pre-patch/libcpp/cpperror.c	2004-05-19 16:00:04.000000000 +0200
+++ gcc/libcpp/cpperror.c	2004-05-19 16:00:39.000000000 +0200
@@ -27,7 +27,6 @@
 #include "system.h"
 #include "cpplib.h"
 #include "cpphash.h"
-#include "intl.h"
 
 static void print_location (cpp_reader *, source_location, unsigned int);
 
diff -rNU3 gcc-pre-patch/libcpp/cppfiles.c gcc/libcpp/cppfiles.c
--- gcc-pre-patch/libcpp/cppfiles.c	2004-05-19 16:00:04.000000000 +0200
+++ gcc/libcpp/cppfiles.c	2004-05-19 16:00:39.000000000 +0200
@@ -25,7 +25,6 @@
 #include "system.h"
 #include "cpplib.h"
 #include "cpphash.h"
-#include "intl.h"
 #include "mkdeps.h"
 #include "hashtab.h"
 #include "md5.h"
@@ -48,10 +47,6 @@
 #  define set_stdin_to_binary_mode() /* Nothing */
 #endif
 
-#ifndef O_BINARY
-# define O_BINARY 0
-#endif
-
 /* This structure represents a file searched for by CPP, whether it
    exists or not.  An instance may be pointed to by more than one
    file_hash_entry; at present no reference count is kept.  */
diff -rNU3 gcc-pre-patch/libcpp/cpppch.c gcc/libcpp/cpppch.c
--- gcc-pre-patch/libcpp/cpppch.c	2004-05-19 16:00:04.000000000 +0200
+++ gcc/libcpp/cpppch.c	2004-05-19 16:00:39.000000000 +0200
@@ -19,7 +19,6 @@
 #include "system.h"
 #include "cpplib.h"
 #include "cpphash.h"
-#include "intl.h"
 #include "hashtab.h"
 #include "mkdeps.h"
 
diff -rNU3 gcc-pre-patch/libcpp/line-map.c gcc/libcpp/line-map.c
--- gcc-pre-patch/libcpp/line-map.c	2004-05-19 16:00:04.000000000 +0200
+++ gcc/libcpp/line-map.c	2004-05-19 16:00:39.000000000 +0200
@@ -23,7 +23,6 @@
 #include "config.h"
 #include "system.h"
 #include "line-map.h"
-#include "intl.h"
 
 static void trace_include (const struct line_maps *, const struct line_map *);
 
diff -rNU3 gcc-pre-patch/libcpp/system.h gcc/libcpp/system.h
--- gcc-pre-patch/libcpp/system.h	1970-01-01 01:00:00.000000000 +0100
+++ gcc/libcpp/system.h	2004-05-19 16:19:57.000000000 +0200
@@ -0,0 +1,365 @@
+/* Get common system includes and various definitions and declarations based
+   on autoconf macros.
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Free Software Foundation, Inc.
+
+This file is part of libcpp (aka cpplib).
+
+GCC is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free
+Software Foundation; either version 2, or (at your option) any later
+version.
+
+GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with GCC; see the file COPYING.  If not, write to the Free
+Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+02111-1307, USA.  */
+
+
+#ifndef LIBCPP_SYSTEM_H
+#define LIBCPP_SYSTEM_H
+
+/* We must include stdarg.h before stdio.h.  */
+#include <stdarg.h>
+
+#ifdef HAVE_STDDEF_H
+# include <stddef.h>
+#endif
+
+#include <stdio.h>
+
+/* Define a generic NULL if one hasn't already been defined.  */
+#ifndef NULL
+#define NULL 0
+#endif
+
+/* The compiler is not a multi-threaded application and therefore we
+   do not have to use the locking functions.  In fact, using the locking
+   functions can cause the compiler to be significantly slower under
+   I/O bound conditions (such as -g -O0 on very large source files).
+
+   HAVE_DECL_PUTC_UNLOCKED actually indicates whether or not the stdio
+   code is multi-thread safe by default.  If it is set to 0, then do
+   not worry about using the _unlocked functions.
+
+   fputs_unlocked, fwrite_unlocked, and fprintf_unlocked are
+   extensions and need to be prototyped by hand (since we do not
+   define _GNU_SOURCE).  */
+
+#if defined HAVE_DECL_PUTC_UNLOCKED && HAVE_DECL_PUTC_UNLOCKED
+
+# ifdef HAVE_PUTC_UNLOCKED
+#  undef putc
+#  define putc(C, Stream) putc_unlocked (C, Stream)
+# endif
+# ifdef HAVE_FPUTC_UNLOCKED
+#  undef fputc
+#  define fputc(C, Stream) fputc_unlocked (C, Stream)
+# endif
+
+# ifdef HAVE_FPUTS_UNLOCKED
+#  undef fputs
+#  define fputs(String, Stream) fputs_unlocked (String, Stream)
+#  if defined (HAVE_DECL_FPUTS_UNLOCKED) && !HAVE_DECL_FPUTS_UNLOCKED
+extern int fputs_unlocked (const char *, FILE *);
+#  endif
+# endif
+# ifdef HAVE_FWRITE_UNLOCKED
+#  undef fwrite
+#  define fwrite(Ptr, Size, N, Stream) fwrite_unlocked (Ptr, Size, N, Stream)
+#  if defined (HAVE_DECL_FWRITE_UNLOCKED) && !HAVE_DECL_FWRITE_UNLOCKED
+extern int fwrite_unlocked (const void *, size_t, size_t, FILE *);
+#  endif
+# endif
+# ifdef HAVE_FPRINTF_UNLOCKED
+#  undef fprintf
+/* We can't use a function-like macro here because we don't know if
+   we have varargs macros.  */
+#  define fprintf fprintf_unlocked
+#  if defined (HAVE_DECL_FPRINTF_UNLOCKED) && !HAVE_DECL_FPRINTF_UNLOCKED
+extern int fprintf_unlocked (FILE *, const char *, ...);
+#  endif
+# endif
+
+#endif
+
+/* ??? Glibc's fwrite/fread_unlocked macros cause
+   "warning: signed and unsigned type in conditional expression".  */
+#undef fread_unlocked
+#undef fwrite_unlocked
+
+#include <sys/types.h>
+#include <errno.h>
+
+#if !defined (errno) && defined (HAVE_DECL_ERRNO) && !HAVE_DECL_ERRNO
+extern int errno;
+#endif
+
+/* Some of glibc's string inlines cause warnings.  Plus we'd rather
+   rely on (and therefore test) GCC's string builtins.  */
+#define __NO_STRING_INLINES
+
+#ifdef STRING_WITH_STRINGS
+# include <string.h>
+# include <strings.h>
+#else
+# ifdef HAVE_STRING_H
+#  include <string.h>
+# else
+#  ifdef HAVE_STRINGS_H
+#   include <strings.h>
+#  endif
+# endif
+#endif
+
+#ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if HAVE_LIMITS_H
+# include <limits.h>
+#endif
+
+/* Infrastructure for defining missing _MAX and _MIN macros.  Note that
+   macros defined with these cannot be used in #if.  */
+
+/* The extra casts work around common compiler bugs.  */
+#define INTTYPE_SIGNED(t) (! ((t) 0 < (t) -1))
+/* The outer cast is needed to work around a bug in Cray C 5.0.3.0.
+   It is necessary at least when t == time_t.  */
+#define INTTYPE_MINIMUM(t) ((t) (INTTYPE_SIGNED (t) \
+                             ? ~ (t) 0 << (sizeof(t) * CHAR_BIT - 1) : (t) 0))
+#define INTTYPE_MAXIMUM(t) ((t) (~ (t) 0 - INTTYPE_MINIMUM (t)))
+
+/* Use that infrastructure to provide a few constants.  */
+#ifndef UCHAR_MAX
+# define UCHAR_MAX INTTYPE_MAXIMUM (unsigned char)
+#endif
+
+#ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+#  include <sys/time.h>
+# else
+#  ifdef HAVE_TIME_H
+#   include <time.h>
+#  endif
+# endif
+#endif
+
+#ifdef HAVE_FCNTL_H
+# include <fcntl.h>
+#else
+# ifdef HAVE_SYS_FILE_H
+#  include <sys/file.h>
+# endif
+#endif
+
+#ifdef HAVE_LOCALE_H
+# include <locale.h>
+#endif
+
+#ifdef HAVE_LANGINFO_CODESET
+# include <langinfo.h>
+#endif
+
+#ifndef HAVE_SETLOCALE
+# define setlocale(category, locale) (locale)
+#endif
+
+#ifdef ENABLE_NLS
+#include <libintl.h>
+#else
+/* Stubs.  */
+# undef dgettext
+# define dgettext(msgid) (msgid)
+#endif
+
+#ifndef _
+# define _(msgid) dgettext (PACKAGE, msgid)
+#endif
+
+#ifndef N_
+# define N_(msgid) msgid
+#endif
+
+/* Some systems define these in, e.g., param.h.  We undefine these names
+   here to avoid the warnings.  We prefer to use our definitions since we
+   know they are correct.  */
+
+#undef MIN
+#undef MAX
+#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))
+#define MAX(X,Y) ((X) > (Y) ? (X) : (Y))
+
+/* The HAVE_DECL_* macros are three-state, undefined, 0 or 1.  If they
+   are defined to 0 then we must provide the relevant declaration
+   here.  These checks will be in the undefined state while configure
+   is running so be careful to test "defined (HAVE_DECL_*)".  */
+
+#if defined (HAVE_DECL_ABORT) && !HAVE_DECL_ABORT
+extern void abort (void);
+#endif
+
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+
+/* Test if something is a normal file.  */
+#ifndef S_ISREG
+#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
+#endif
+
+/* Test if something is a directory.  */
+#ifndef S_ISDIR
+#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
+#endif
+
+/* Test if something is a character special file.  */
+#ifndef S_ISCHR
+#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
+#endif
+
+/* Test if something is a block special file.  */
+#ifndef S_ISBLK
+#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
+#endif
+
+/* Test if something is a socket.  */
+#ifndef S_ISSOCK
+# ifdef S_IFSOCK
+#   define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
+# else
+#   define S_ISSOCK(m) 0
+# endif
+#endif
+
+/* Test if something is a FIFO.  */
+#ifndef S_ISFIFO
+# ifdef S_IFIFO
+#  define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
+# else
+#  define S_ISFIFO(m) 0
+# endif
+#endif
+
+/* Approximate O_NOCTTY.  */
+#ifndef O_NOCTTY
+#define O_NOCTTY 0
+#endif
+
+/* Approximate O_NOCTTY.  */
+#ifndef O_BINARY
+# define O_BINARY 0
+#endif
+
+/* Filename handling macros.  */
+#include "filenames.h"
+
+/* Get libiberty declarations.  */
+#include "libiberty.h"
+#include "safe-ctype.h"
+
+/* 1 if we have C99 designated initializers.  */
+#if !defined(HAVE_DESIGNATED_INITIALIZERS)
+#define HAVE_DESIGNATED_INITIALIZERS \
+  ((GCC_VERSION >= 2007) || (__STDC_VERSION__ >= 199901L))
+#endif
+
+/* 1 if we have _Bool.  */
+#ifndef HAVE__BOOL
+# define HAVE__BOOL \
+   ((GCC_VERSION >= 3000) || (__STDC_VERSION__ >= 199901L))
+#endif
+
+
+/* Be conservative and only use enum bitfields with GCC.
+   FIXME: provide a complete autoconf test for buggy enum bitfields.  */
+
+#if (GCC_VERSION > 2000)
+#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE
+#else
+#define ENUM_BITFIELD(TYPE) unsigned int
+#endif
+
+/* We only use bool bitfields with gcc3.  Some supposedly C99
+   compilers don't handle them correctly.  */
+#if (GCC_VERSION >= 3000)
+#define BOOL_BITFIELD _Bool
+#else
+#define BOOL_BITFIELD unsigned int
+#endif
+
+#ifndef offsetof
+#define offsetof(TYPE, MEMBER)	((size_t) &((TYPE *) 0)->MEMBER)
+#endif
+
+/* __builtin_expect(A, B) evaluates to A, but notifies the compiler that
+   the most likely value of A is B.  This feature was added at some point
+   between 2.95 and 3.0.  Let's use 3.0 as the lower bound for now.  */
+#if (GCC_VERSION < 3000)
+#define __builtin_expect(a, b) (a)
+#endif
+
+/* Provide some sort of boolean type.  We use stdbool.h if it's
+  available.  This must be after all inclusion of system headers,
+  as some of them will mess us up.  */
+#undef bool
+#undef true
+#undef false
+#undef TRUE
+#undef FALSE
+
+#ifdef HAVE_STDBOOL_H
+# include <stdbool.h>
+#else
+# if !HAVE__BOOL
+typedef char _Bool;
+# endif
+# define bool _Bool
+# define true 1
+# define false 0
+#endif
+
+#if (GCC_VERSION >= 3000)
+#undef calloc
+#undef strdup
+#undef malloc
+#undef realloc
+ #pragma GCC poison calloc strdup
+ #pragma GCC poison malloc realloc
+
+/* Libiberty macros that are no longer used in GCC.  */
+#undef ANSI_PROTOTYPES
+#undef PTR_CONST
+#undef LONG_DOUBLE
+#undef VPARAMS
+#undef VA_OPEN
+#undef VA_FIXEDARG
+#undef VA_CLOSE
+#undef VA_START
+ #pragma GCC poison ANSI_PROTOTYPES PTR_CONST LONG_DOUBLE VPARAMS VA_OPEN \
+  VA_FIXEDARG VA_CLOSE VA_START
+
+/* Note: not all uses of the `index' token (e.g. variable names and
+   structure members) have been eliminated.  */
+#undef bcopy
+#undef bzero
+#undef bcmp
+#undef rindex
+ #pragma GCC poison bcopy bzero bcmp rindex
+
+#endif /* GCC >= 3.0 */
+
+#endif /* ! LIBCPP_SYSTEM_H */
diff -rNU3 gcc-pre-patch/libiberty/hashtab.c gcc/libiberty/hashtab.c
--- gcc-pre-patch/libiberty/hashtab.c	2004-05-19 16:00:07.000000000 +0200
+++ gcc/libiberty/hashtab.c	2004-05-20 11:39:43.000000000 +0200
@@ -822,7 +822,7 @@
 
 /* Hash P as a null-terminated string.
 
-   Copied from gcc/hashtable.c.  Zack had the following to say with respect
+   Copied from libcpp/hashtable.c.  Zack had the following to say with respect
    to applicability, though note that unlike hashtable.c, this hash table
    implementation re-hashes rather than chain buckets.
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]