Allow alloc-pool.c to be used by build/ programs

Richard Sandiford rsandifo@nildram.co.uk
Fri May 2 09:07:00 GMT 2008


The genrecog patch I'm about to post relies on alloc pools,
so this patch makes it possible to include alloc-pool.o in
build programs.  It's only useful if the follow-on patch is OK,
but I thought I'd post is separately for ease of review.

Bootstrapped & regression-tested on x86_64-linux-gnu.
OK to install?

Richard


gcc/
	* Makefile.in (build/alloc-pool.o): New rule.
	* alloc-pool.c: Include bconfig.h instead of config.h if
	GENERATOR_FILE is defined.

Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in	2008-05-01 19:32:56.000000000 +0100
+++ gcc/Makefile.in	2008-05-02 09:59:24.000000000 +0100
@@ -3181,6 +3181,8 @@ build/%.o :  # dependencies provided by 
 
 # Header dependencies for the programs that generate source code.
 # These are library modules...
+build/alloc-pool.o : alloc-pool.c $(BCONFIG_H) $(SYSTEM_H) alloc-pool.h \
+  $(HASHTAB_H)
 build/errors.o : errors.c $(BCONFIG_H) $(SYSTEM_H) errors.h
 build/gensupport.o: gensupport.c $(BCONFIG_H) $(SYSTEM_H) coretypes.h	\
   $(GTM_H) $(RTL_BASE_H) $(OBSTACK_H) errors.h $(HASHTAB_H)		\
Index: gcc/alloc-pool.c
===================================================================
--- gcc/alloc-pool.c	2008-05-01 19:32:56.000000000 +0100
+++ gcc/alloc-pool.c	2008-05-01 19:33:15.000000000 +0100
@@ -19,7 +19,11 @@ Software Foundation; either version 3, o
 along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
+#ifdef GENERATOR_FILE
+#include "bconfig.h"
+#else
 #include "config.h"
+#endif
 #include "system.h"
 #include "alloc-pool.h"
 #include "hashtab.h"



More information about the Gcc-patches mailing list