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]

Re: [PATCH] update prototize.c to match CPP's include handling


Permission to commit this to mainline and 3.1?

On Sat, Apr 13, 2002 at 01:08:46PM -0700, David O'Brien wrote:
> Did this every get committed?  It would be most helpful on the 3.1
> branch.
> 
> ----- Forwarded message from Zack Weinberg <zack@codesourcery.com> -----
> 
> 	* Makefile.in (PROTO_OBJS): Add cppdefault.o.
> 	(protoize.o): Take $(PREPROCESSOR_DEFINES) off command line.
> 	(unprotoize.o): Ditto.  Build from protoize.c.  Define
> 	UNPROTOIZE on command line.
> 	* protoize.c: Include cppdefault.h.  Delete include_defaults.
> 	(in_system_include_dir): Use cpp_include_defaults (defined in
> 	cppdefault.o).
> 	* unprotoize.c: Delete file.
> 
> ===================================================================
> Index: Makefile.in
> --- Makefile.in	2002/03/31 22:59:14	1.852
> +++ Makefile.in	2002/04/03 18:47:53
> @@ -2016,7 +2016,7 @@ $(srcdir)/tradcif.c: $(srcdir)/tradcif.y
>  
>  proto: config.status protoize$(exeext) unprotoize$(exeext) SYSCALLS.c.X
>  
> -PROTO_OBJS = intl.o version.o
> +PROTO_OBJS = intl.o version.o cppdefault.o
>  
>  protoize$(exeext): protoize.o $(PROTO_OBJS) $(LIBDEPS)
>  	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ protoize.o $(PROTO_OBJS) $(LIBS)
> @@ -2029,16 +2029,16 @@ protoize.o: protoize.c $(srcdir)/../incl
>  	(SHLIB_LINK='$(SHLIB_LINK)' \
>  	SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
>  	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
> -	  $(DRIVER_DEFINES) $(PREPROCESSOR_DEFINES) \
> +	  $(DRIVER_DEFINES) \
>  	  $(srcdir)/protoize.c $(OUTPUT_OPTION))
>  
> -unprotoize.o: unprotoize.c protoize.c $(srcdir)/../include/getopt.h \
> +unprotoize.o: protoize.c $(srcdir)/../include/getopt.h \
>     $(CONFIG_H) $(SYSTEM_H) Makefile version.h
>  	(SHLIB_LINK='$(SHLIB_LINK)' \
>  	SHLIB_MULTILIB='$(SHLIB_MULTILIB)'; \
> -	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
> -	  $(DRIVER_DEFINES) $(PREPROCESSOR_DEFINES) \
> -	  $(srcdir)/unprotoize.c $(OUTPUT_OPTION))
> +	$(CC) -c -DUNPROTOIZE $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
> +	  $(DRIVER_DEFINES) \
> +	  $(srcdir)/protoize.c $(OUTPUT_OPTION))
>  
>  # This info describes the target machine, so compile with GCC just built.
>  SYSCALLS.c.X: $(srcdir)/sys-types.h $(srcdir)/sys-protos.h $(GCC_PASSES) \
> ===================================================================
> Index: protoize.c
> --- protoize.c	2002/04/03 03:40:56	1.73
> +++ protoize.c	2002/04/03 18:47:54
> @@ -22,6 +22,7 @@ Software Foundation, 59 Temple Place - S
>  #include "config.h"
>  #include "system.h"
>  #include "intl.h"
> +#include "cppdefault.h"
>  
>  #include <setjmp.h>
>  #include <signal.h>
> @@ -194,61 +195,7 @@ static const unexpansion unexpansions[] 
>  
>  static const int hash_mask = (HASH_TABLE_SIZE - 1);
>  
> -/* Make a table of default system include directories
> -   just as it is done in cpp.  */
>  
> -static const struct default_include { const char *const fname; 
> -			 const char *const component;
> -			 const int x1, x2; } include_defaults[]
> -#ifdef INCLUDE_DEFAULTS
> -  = INCLUDE_DEFAULTS;
> -#else
> -  = {
> -    /* Pick up GNU C++ specific include files.  */
> -    { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },
> -#ifdef CROSS_COMPILE
> -#ifdef GCC_INCLUDE_DIR
> -    /* This is the dir for fixincludes.  Put it just before
> -       the files that we fix.  */
> -    { GCC_INCLUDE_DIR, "GCC", 0, 0 },
> -#endif
> -#ifdef CROSS_INCLUDE_DIR
> -    /* For cross-compilation, this dir name is generated
> -       automatically in Makefile.in.  */
> -    { CROSS_INCLUDE_DIR, 0, 0, 0 },
> -#endif
> -#ifdef TOOL_INCLUDE_DIR
> -    /* This is another place that the target system's headers might be.  */
> -    { TOOL_INCLUDE_DIR, "BINUTILS", 0, 0 },
> -#endif
> -#else /* not CROSS_COMPILE */
> -#ifdef LOCAL_INCLUDE_DIR
> -    /* This should be /use/local/include and should come before
> -       the fixincludes-fixed header files.  */
> -    { LOCAL_INCLUDE_DIR, 0, 0, 1 },
> -#endif
> -#ifdef TOOL_INCLUDE_DIR
> -    /* This is here ahead of GCC_INCLUDE_DIR because assert.h goes here.
> -       Likewise, behind LOCAL_INCLUDE_DIR, where glibc puts its assert.h.  */
> -    { TOOL_INCLUDE_DIR, "BINUTILS", 0, 0 },
> -#endif
> -#ifdef GCC_INCLUDE_DIR
> -    /* This is the dir for fixincludes.  Put it just before
> -       the files that we fix.  */
> -    { GCC_INCLUDE_DIR, "GCC", 0, 0 },
> -#endif
> -    /* Some systems have an extra dir of include files.  */
> -#ifdef SYSTEM_INCLUDE_DIR
> -    { SYSTEM_INCLUDE_DIR, 0, 0, 0 },
> -#endif
> -#ifdef STANDARD_INCLUDE_DIR
> -    { STANDARD_INCLUDE_DIR, 0, 0, 0},
> -#endif
> -#endif /* not CROSS_COMPILE */
> -    { 0, 0, 0, 0}
> -    };
> -#endif /* no INCLUDE_DEFAULTS */
> -
>  /* Datatype for lists of directories or filenames.  */
>  struct string_list
>  {
> @@ -754,7 +701,7 @@ in_system_include_dir (path)
>    if (! is_abspath (path))
>      abort ();		/* Must be an absolutized filename.  */
>  
> -  for (p = include_defaults; p->fname; p++)
> +  for (p = cpp_include_defaults; p->fname; p++)
>      if (!strncmp (path, p->fname, strlen (p->fname))
>  	&& IS_DIR_SEPARATOR (path[strlen (p->fname)]))
>        return 1;
> ===================================================================
> Index: unprotoize.c
> --- unprotoize.c	Wed Apr  3 10:47:57 2002
> +++ unprotoize.c	Tue May  5 13:32:27 1998
> @@ -1,2 +0,0 @@
> -#define UNPROTOIZE
> -#include "protoize.c"
> 
> ----- End forwarded message -----

-- 
-- David  (obrien@FreeBSD.org)
          Disclaimer: Not speaking for FreeBSD, just expressing my own opinion.


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