Index: src/gcc/Makefile.in =================================================================== --- src/gcc/Makefile.in (revision 237184) +++ src/gcc/Makefile.in (working copy) @@ -130,7 +130,15 @@ # Variables that exist for you to override. # See below for how to change them for certain systems. +# Helper code from gnulib. +GNULIB_BUILDDIR = build-gnulib +LIBGNU = $(GNULIB_BUILDDIR)/import/libgnu.a +INCGNU = -I$(srcdir)/gnulib/import -I$(GNULIB_BUILDDIR)/import +# Generated headers in the gnulib directory. These must be listed +# so that they are generated before other files are compiled. +GNULIB_H = $(GNULIB_BUILDDIR)/import/string.h @GNULIB_STDINT_H@ + # List of language subdirectories. SUBDIRS =@subdirs@ build @@ -1024,7 +1032,7 @@ # Dependencies on the intl and portability libraries. LIBDEPS= libcommon.a $(CPPLIB) $(LIBIBERTY) $(LIBINTL_DEP) $(LIBICONV_DEP) \ - $(LIBDECNUMBER) $(LIBBACKTRACE) + $(LIBDECNUMBER) $(LIBBACKTRACE) $(LIBGNU) # Likewise, for use in the tools that must run on this machine # even if we are cross-building GCC. @@ -1066,7 +1074,7 @@ INCLUDES = -I. -I$(@D) -I$(srcdir) -I$(srcdir)/$(@D) \ -I$(srcdir)/../include @INCINTL@ \ $(CPPINC) $(GMPINC) $(DECNUMINC) $(BACKTRACEINC) \ - $(ISLINC) + $(ISLINC) $(INCGNU) COMPILE.base = $(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) -o $@ ifeq ($(CXXDEPMODE),depmode=gcc3) @@ -1708,6 +1716,13 @@ CONFIG_SHELL="$(SHELL)" \ CONFIG_FILES=$@ $(SHELL) config.status +$(GNULIB_BUILDDIR)/Makefile: $(srcdir)/gnulib/Makefile.in config.status + cd $(GNULIB_BUILDDIR); CONFIG_FILES="Makefile" \ + CONFIG_COMMANDS="depfiles" \ + CONFIG_HEADERS= \ + CONFIG_LINKS= \ + $(SHELL) config.status + config.h: cs-config.h ; @true bconfig.h: cs-bconfig.h ; @true tconfig.h: cs-tconfig.h ; @true @@ -1860,6 +1875,11 @@ selftest-gdb: $(GCC_PASSES) cc1$(exeext) stmp-int-hdrs $(GCC_FOR_TARGET) -xc -S -c /dev/null -fself-test -wrapper gdb,--args +.PHONY: all-lib +$(LIBGNU) $(GNULIB_H): all-lib +all-lib: $(GNULIB_BUILDDIR)/Makefile + $(MAKE) $(FLAGS_TO_PASS) DO=all DODIRS=$(GNULIB_BUILDDIR) subdir_do + # Recompile all the language-independent object files. # This is used only if the user explicitly asks for it. compilations: $(BACKEND) Index: src/gcc/configure.ac =================================================================== --- src/gcc/configure.ac (revision 237184) +++ src/gcc/configure.ac (working copy) @@ -78,6 +78,26 @@ *** and run configure again.]) fi +gnulib_extra_configure_args= +# If large-file support is disabled, make sure gnulib does the same. +if test "$enable_largefile" = no; then +gnulib_extra_configure_args="$gnulib_extra_configure_args --disable-largefile" +fi + +# Configure gnulib. +ACX_CONFIGURE_DIR(["gnulib"], ["build-gnulib"], + ["$gnulib_extra_configure_args"]) + + +GNULIB=build-gnulib/import + +# For Makefile dependencies. +GNULIB_STDINT_H= +if test x"$STDINT_H" != x; then + GNULIB_STDINT_H=$GNULIB/$STDINT_H +fi +AC_SUBST(GNULIB_STDINT_H) + # Test if GCC_EXEC_PREFIX contains the notation for the current directory # since this would lead to problems installing/building glibc. # GCC_EXEC_PREFIX contains the current directory if one of the following