View | Details | Raw Unified | Return to bug 11572 | Differences between
and this patch

Collapse All | Expand All | Context: (Patch / File /
)

(-)gcc/gcc/c-incpath.c (-3 / +13 lines)
 Lines 372-383   register_include_chains (cpp_reader *pfi Link Here 
372
     include chain.  */
372
     include chain.  */
373
  add_env_var_paths ("CPATH", BRACKET);
373
  add_env_var_paths ("CPATH", BRACKET);
374
  add_env_var_paths (lang_env_vars[idx], SYSTEM);
374
  add_env_var_paths (lang_env_vars[idx], SYSTEM);
375
  
376
  target_c_incpath.extra_pre_includes (sysroot, iprefix, stdinc);
375
377
376
  /* Finally chain on the standard directories.  */
378
  /* Finally chain on the standard directories.  */
377
  if (stdinc)
379
  if (stdinc)
378
    add_standard_paths (sysroot, iprefix, cxx_stdinc);
380
    add_standard_paths (sysroot, iprefix, cxx_stdinc);
379
381
380
  target_c_incpath.extra_includes (stdinc);
382
  target_c_incpath.extra_includes (sysroot, iprefix, stdinc);
381
383
382
  merge_include_chains (pfile, verbose);
384
  merge_include_chains (pfile, verbose);
383
385
 Lines 386-392   register_include_chains (cpp_reader *pfi Link Here 
386
}
388
}
387
389
388
#ifndef TARGET_EXTRA_INCLUDES
390
#ifndef TARGET_EXTRA_INCLUDES
389
static void hook_void_int(int u ATTRIBUTE_UNUSED) { }
391
static void hook_void_charptr_charptr_int (const char *sysroot ATTRIBUTE_UNUSED,
392
					   const char *iprefix ATTRIBUTE_UNUSED,
393
					   int stdinc ATTRIBUTE_UNUSED)
394
{
395
}
390
396
391
struct target_c_incpath_s target_c_incpath = { hook_void_int };
397
struct target_c_incpath_s target_c_incpath =
398
{
399
  hook_void_charptr_charptr_int,
400
  hook_void_charptr_charptr_int
401
};
392
#endif
402
#endif
(-)gcc/gcc/c-incpath.h (-2 / +3 lines)
 Lines 23-33   extern void add_cpp_dir_path (struct cpp Link Here 
23
23
24
struct target_c_incpath_s {
24
struct target_c_incpath_s {
25
  /* Do extra includes processing.  STDINC is false iff -nostdinc was given.  */
25
  /* Do extra includes processing.  STDINC is false iff -nostdinc was given.  */
26
  void (*extra_includes) (int);
26
  void (*extra_pre_includes) (const char *, const char *, int);
27
  void (*extra_includes) (const char *, const char *, int);
27
};
28
};
28
29
29
extern struct target_c_incpath_s target_c_incpath;
30
extern struct target_c_incpath_s target_c_incpath;
30
31
31
#define C_INCPATH_INIT { TARGET_EXTRA_INCLUDES }
32
#define C_INCPATH_INIT { TARGET_EXTRA_PRE_INCLUDES, TARGET_EXTRA_INCLUDES }
32
33
33
enum { QUOTE = 0, BRACKET, SYSTEM, AFTER };
34
enum { QUOTE = 0, BRACKET, SYSTEM, AFTER };
(-)gcc/gcc/fix-header.c (-2 / +10 lines)
 Lines 85-93   static void v_fatal (const char *, va_li Link Here 
85
static void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
85
static void fatal (const char *, ...) ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
86
86
87
#ifdef TARGET_EXTRA_INCLUDES
87
#ifdef TARGET_EXTRA_INCLUDES
88
static void hook_void_int(int u ATTRIBUTE_UNUSED) { }
88
static void hook_void_charptr_charptr_int (const char *sysroot ATTRIBUTE_UNUSED,
89
					   const char *iprefix ATTRIBUTE_UNUSED,
90
					   int stdinc ATTRIBUTE_UNUSED)
91
{
92
}
89
93
90
struct target_c_incpath_s target_c_incpath = { hook_void_int };
94
struct target_c_incpath_s target_c_incpath =
95
{
96
  hook_void_charptr_charptr_int,
97
  hook_void_charptr_charptr_int
98
};
91
#endif
99
#endif
92
100
93
struct line_maps line_table;
101
struct line_maps line_table;
(-)gcc/gcc/config/darwin-c.c (-1 / +44 lines)
 Lines 30-35   Boston, MA 02111-1307, USA. */ Link Here 
30
#include "c-incpath.h"
30
#include "c-incpath.h"
31
#include "toplev.h"
31
#include "toplev.h"
32
#include "tm_p.h"
32
#include "tm_p.h"
33
#include "cppdefault.h"
34
#include "prefix.h"
33
35
34
/* Pragmas.  */
36
/* Pragmas.  */
35
37
 Lines 420-432   static const char *framework_defaults [] Link Here 
420
    "/Local/Library/Frameworks",
422
    "/Local/Library/Frameworks",
421
  };
423
  };
422
424
425
/* Register the GNU objective-C runtime include path if STDINC.  */
426
427
void
428
darwin_register_objc_includes (const char *sysroot, const char *iprefix,
429
			       int stdinc)
430
{
431
  const char *fname;
432
  size_t len;
433
  /* We do not do anything if we do not want the standard includes */
434
  if (!stdinc)
435
    return;
436
  
437
  fname = GCC_INCLUDE_DIR "-gnu-runtime";
438
  
439
  /* Register the GNU OBJC runtime inlcude path if this compiling GNU-runtime
440
     and OBJ-C.  */
441
  if (c_dialect_objc () && !flag_next_runtime)
442
    {
443
      char *str;
444
      /* See if our directory starts with the standard prefix.
445
	 "Translate" them, ie. replace /usr/local/lib/gcc... with
446
	 IPREFIX and search them first.  */
447
      if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0 && !sysroot
448
	  && !strncmp (fname, cpp_GCC_INCLUDE_DIR, len))
449
	{
450
	  str = concat (iprefix, fname + len, NULL);
451
          /* FIXME: wrap the headers for C++awareness.  */
452
	  add_path (str, SYSTEM, /*c++aware=*/false, false);
453
	}
454
      
455
      /* Should this directory start with the sysroot?  */
456
      if (sysroot)
457
	str = concat (sysroot, fname, NULL);
458
      else
459
	str = update_path (fname, "");
460
      
461
      add_path (str, SYSTEM, /*c++aware=*/false, false);
462
    }
463
}
464
423
465
424
/* Register all the system framework paths if STDINC is true and setup
466
/* Register all the system framework paths if STDINC is true and setup
425
   the missing_header callback for subframework searching if any
467
   the missing_header callback for subframework searching if any
426
   frameworks had been registered.  */
468
   frameworks had been registered.  */
427
469
428
void
470
void
429
darwin_register_frameworks (int stdinc)
471
darwin_register_frameworks (const char *sysroot ATTRIBUTE_UNUSED,
472
			    const char *iprefix ATTRIBUTE_UNUSED, int stdinc)
430
{
473
{
431
  if (stdinc)
474
  if (stdinc)
432
    {
475
    {
(-)gcc/gcc/config/darwin.h (-1 / +3 lines)
 Lines 916-922   enum machopic_addr_class { Link Here 
916
#undef ASM_APP_OFF
916
#undef ASM_APP_OFF
917
#define ASM_APP_OFF ""
917
#define ASM_APP_OFF ""
918
918
919
void darwin_register_frameworks (int);
919
void darwin_register_frameworks (const char *, const char *, int);
920
void darwin_register_objc_includes (const char *, const char *, int);
921
#define TARGET_EXTRA_PRE_INCLUDES darwin_register_objc_includes
920
#define TARGET_EXTRA_INCLUDES darwin_register_frameworks
922
#define TARGET_EXTRA_INCLUDES darwin_register_frameworks
921
923
922
void add_framework_path (char *);
924
void add_framework_path (char *);
(-)gcc/gcc/config/t-darwin (-1 / +1 lines)
 Lines 7-13   darwin.o: $(srcdir)/config/darwin.c $(CO Link Here 
7
darwin-c.o: $(srcdir)/config/darwin-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
7
darwin-c.o: $(srcdir)/config/darwin-c.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
8
  $(TM_H) $(CPPLIB_H) tree.h c-pragma.h $(C_TREE_H) toplev.h $(TM_P_H) \
8
  $(TM_H) $(CPPLIB_H) tree.h c-pragma.h $(C_TREE_H) toplev.h $(TM_P_H) \
9
  c-incpath.h
9
  c-incpath.h
10
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/darwin-c.c
10
	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/darwin-c.c $(PREPROCESSOR_DEFINES)
11
11
12
gt-darwin.h : s-gtype ; @true
12
gt-darwin.h : s-gtype ; @true
13
13
(-)gcc/gcc/doc/tm.texi (-2 / +11 lines)
 Lines 9245-9254   system library's @code{pow}, @code{powf} Link Here 
9245
The default value places no upper bound on the multiplication count.
9245
The default value places no upper bound on the multiplication count.
9246
@end defmac
9246
@end defmac
9247
9247
9248
@deftypefn Macro void TARGET_EXTRA_INCLUDES (int @var{stdinc})
9248
@deftypefn Macro void TARGET_EXTRA_INCLUDES (const char *@var{sysroot}, const char *@var{iprefix}, int @var{stdinc})
9249
This target hook should register any extra include files for the
9249
This target hook should register any extra include files for the
9250
target.  The parameter @var{stdinc} indicates if normal include files
9250
target.  The parameter @var{stdinc} indicates if normal include files
9251
are present.
9251
are present.  The parameter @var{sysroot} is the system root directory.
9252
The parameter @var{iprefix} is the prefix for the gcc directory.
9253
@end deftypefn
9254
9255
@deftypefn Macro void TARGET_EXTRA_PRE_INCLUDES (const char *@var{sysroot}, const char *@var{iprefix}, int @var{stdinc})
9256
This target hook should register any extra include files for the
9257
target before any standard headers.  The parameter @var{stdinc}
9258
indicates if normal include files are present.  The parameter
9259
@var{sysroot} is the system root directory.  The parameter
9260
@var{iprefix} is the prefix for the gcc directory.
9252
@end deftypefn
9261
@end deftypefn
9253
9262
9254
@deftypefn Macro void TARGET_OPTF (char *@var{path})
9263
@deftypefn Macro void TARGET_OPTF (char *@var{path})

Return to bug 11572